@@ -2251,6 +2251,60 @@ describe('ERC-7730 descriptors', () => {
22512251 } )
22522252 } )
22532253
2254+ test ( 'keeps the Safe delegatecall warning after ERC-7730 execTransaction humanization' , ( ) => {
2255+ const safeProxy = '0x043faB48aCC3DD066fcf33cA3e3f2E2Ba5be9018'
2256+ const recipeExecutor = '0xc91305DdE651c899EF8eE1D0C33E7dab1B5ABF0D'
2257+ const execTransactionData = new ethers . Interface ( execTransactionAbi ) . encodeFunctionData (
2258+ 'execTransaction' ,
2259+ [ recipeExecutor , 0 , '0x0c2c8750' , 1 , 0 , 0 , 0 , ZeroAddress , ZeroAddress , '0x' ]
2260+ )
2261+ const safeExecAccountOp : AccountOp = {
2262+ ...accountOp ,
2263+ chainId : 8453n ,
2264+ calls : [
2265+ {
2266+ to : safeProxy ,
2267+ value : 0n ,
2268+ data : execTransactionData
2269+ }
2270+ ]
2271+ }
2272+ const irCalls = humanizeAccountOp ( safeExecAccountOp , {
2273+ erc7730Descriptors : {
2274+ 0 : {
2275+ descriptor : {
2276+ display : {
2277+ formats : {
2278+ 'execTransaction(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,bytes signatures)' :
2279+ {
2280+ intent : 'sign multisig operation' ,
2281+ fields : [
2282+ { path : 'operation' , label : 'Operation type' } ,
2283+ {
2284+ path : 'data' ,
2285+ label : 'Transaction' ,
2286+ format : 'calldata' ,
2287+ params : { calleePath : 'to' }
2288+ }
2289+ ]
2290+ }
2291+ }
2292+ }
2293+ }
2294+ }
2295+ }
2296+ } )
2297+
2298+ expect ( irCalls [ 0 ] ?. warnings ) . toEqual ( [
2299+ getWarning (
2300+ 'You are about to delegate permissions to a contract not whitelisted by Safe. Proceed with caution' ,
2301+ 'SAFE{WALLET}_DELEGATE_CALL' ,
2302+ undefined ,
2303+ recipeExecutor
2304+ )
2305+ ] )
2306+ } )
2307+
22542308 test ( 'humanizes Safe setup calldata nested in a factory initializer with ERC-7730' , ( ) => {
22552309 const safeProxyFactory = '0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67'
22562310 const safeSingleton = '0x41675c099f32341bf84bfc5382af534df5c7461a'
0 commit comments