Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tiny-trainers-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/devtools-evm": patch
---

Add fix so call is enforced instead of delegatecall for gnosis safe batch tx signing
10 changes: 5 additions & 5 deletions packages/devtools-evm/src/signer/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
type OmniTransaction,
type OmniPoint,
} from '@layerzerolabs/devtools'
import assert from 'assert'

import { ethers } from 'ethers'

export abstract class OmniSignerEVMBase extends OmniSignerBase implements OmniSigner {
Expand Down Expand Up @@ -99,10 +97,11 @@ export class GnosisOmniSignerEVM<TSafeConfig extends ConnectSafeConfig> extends
}

async signAndSendBatch(transactions: OmniTransaction[]): Promise<OmniTransactionResponse> {
assert(transactions.length > 0, `signAndSendBatch received 0 transactions`)
if (transactions.length === 0) {
Comment thread
ItsAdel marked this conversation as resolved.
throw new Error('/signAndSendBatch received 0 transactions')
Comment thread
ItsAdel marked this conversation as resolved.
}

const safeTransaction = await this.#createSafeTransaction(transactions)

return this.#proposeSafeTransaction(safeTransaction)
}

Expand Down Expand Up @@ -141,7 +140,8 @@ export class GnosisOmniSignerEVM<TSafeConfig extends ConnectSafeConfig> extends
return safeSdk.createTransaction({
safeTransactionData: transactions.map((transaction) => this.#serializeTransaction(transaction)),
options: { nonce },
})
onlyCalls: true,
Comment thread
ItsAdel marked this conversation as resolved.
} as any)
Comment thread
ItsAdel marked this conversation as resolved.
}

#serializeTransaction(transaction: OmniTransaction): MetaTransactionData {
Expand Down
1 change: 1 addition & 0 deletions packages/devtools-evm/test/signer/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ describe('signer/ethers', () => {
operation: OperationType.Call,
})),
options: { nonce },
onlyCalls: true,
})

expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)
Expand Down