File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @layerzerolabs/devtools-evm " : patch
3+ ---
4+
5+ Add fix so call is enforced instead of delegatecall for gnosis safe batch tx signing
Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ import {
1111 type OmniTransaction ,
1212 type OmniPoint ,
1313} from '@layerzerolabs/devtools'
14- import assert from 'assert'
15-
1614import { ethers } from 'ethers'
1715
1816export abstract class OmniSignerEVMBase extends OmniSignerBase implements OmniSigner {
@@ -99,10 +97,11 @@ export class GnosisOmniSignerEVM<TSafeConfig extends ConnectSafeConfig> extends
9997 }
10098
10199 async signAndSendBatch ( transactions : OmniTransaction [ ] ) : Promise < OmniTransactionResponse > {
102- assert ( transactions . length > 0 , `signAndSendBatch received 0 transactions` )
100+ if ( transactions . length === 0 ) {
101+ throw new Error ( '/signAndSendBatch received 0 transactions' )
102+ }
103103
104104 const safeTransaction = await this . #createSafeTransaction( transactions )
105-
106105 return this . #proposeSafeTransaction( safeTransaction )
107106 }
108107
@@ -141,7 +140,8 @@ export class GnosisOmniSignerEVM<TSafeConfig extends ConnectSafeConfig> extends
141140 return safeSdk . createTransaction ( {
142141 safeTransactionData : transactions . map ( ( transaction ) => this . #serializeTransaction( transaction ) ) ,
143142 options : { nonce } ,
144- } )
143+ onlyCalls : true ,
144+ } as any )
145145 }
146146
147147 #serializeTransaction( transaction : OmniTransaction ) : MetaTransactionData {
Original file line number Diff line number Diff line change @@ -283,6 +283,7 @@ describe('signer/ethers', () => {
283283 operation : OperationType . Call ,
284284 } ) ) ,
285285 options : { nonce } ,
286+ onlyCalls : true ,
286287 } )
287288
288289 expect ( apiKit . getNextNonce ) . toHaveBeenCalledWith ( safeAddress )
You can’t perform that action at this time.
0 commit comments