Skip to content

Commit

Permalink
provider: forbid all self calls
Browse files Browse the repository at this point in the history
  • Loading branch information
attente committed Jul 27, 2023
1 parent 6c4b7a9 commit 1a2c7ee
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/provider/src/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ function validateTransaction(wallet: string, transaction: commons.transaction.Tr
if (transaction.data) {
const data = ethers.utils.arrayify(transaction.data)
if (data.length >= 4) {
const selector = ethers.utils.hexlify(data.slice(0, 4))
switch (selector) {
case '0x7a9a1628': // execute((bool,bool,uint256,address,uint256,bytes)[],uint256,bytes)
case '0x61c2926c': // selfExecute((bool,bool,uint256,address,uint256,bytes)[])
break
default:
throw new Error('self calls other than execute and selfExecute are forbidden')
}
throw new Error('self calls are forbidden')
}
}
}
Expand Down

0 comments on commit 1a2c7ee

Please sign in to comment.