Skip to content

Commit

Permalink
🪲 squads multisig support (#1022)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Goulding <goulding@layerzerolabs.org>
  • Loading branch information
ryandgoulding authored Nov 14, 2024
1 parent e2395b5 commit 8cd6a65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-mayflies-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/ua-devtools-solana": patch
---

Fix Squads Multisig Support
1 change: 1 addition & 0 deletions examples/oft-solana/tasks/common/wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ task(TASK_LZ_OWNABLE_TRANSFER_OWNERSHIP)
// Only pass this if you deployed a new OFT program, if you are using the default
// LayerZero OFT program you can omit this
.addParam('solanaProgramId', 'The OFT program ID to use', undefined, publicKey, true)
.addParam('multisigKey', 'The MultiSig key', undefined, publicKey, true)
.setAction(async (args: Args, hre) => {
return hre.run(TASK_LZ_OAPP_WIRE, { ...args, internalConfigurator: configureOwnable })
})
Expand Down
11 changes: 4 additions & 7 deletions packages/ua-devtools-solana/src/oft/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export class OFT extends OmniSDK implements IOApp {
this._umiToWeb3Tx([
oft.initConfig(
{
admin: await this._getOwnerSigner(),
admin: await this._getAdmin(),
oftStore: this.umiPublicKey,
payer: createNoopSigner(this.umiUserAccount),
},
Expand Down Expand Up @@ -476,7 +476,7 @@ export class OFT extends OmniSDK implements IOApp {
return oft.setOFTConfig(
{
oftStore: this.umiPublicKey,
admin: (await this.getOwner()) as unknown as Signer,
admin: await this._getAdmin(),
},
param,
{
Expand All @@ -503,7 +503,7 @@ export class OFT extends OmniSDK implements IOApp {
return oft.setPeerConfig(
{
oftStore: this.umiPublicKey,
admin: await this._getOwnerSigner(),
admin: await this._getAdmin(),
},
param,
this.umiProgramId
Expand Down Expand Up @@ -574,11 +574,8 @@ export class OFT extends OmniSDK implements IOApp {
return web3Transaction
}

protected async _getOwnerSigner(): Promise<Signer> {
protected async _getAdmin(): Promise<Signer> {
const owner = await this.getOwner()
if (!owner) {
throw new Error(`No owner found for ${this.label}`)
}
return createNoopSigner(publicKey(owner))
}
}
Expand Down

0 comments on commit 8cd6a65

Please sign in to comment.