@@ -2,6 +2,7 @@ use super::{bail, ensure, fmt_err, Cheatcodes, Result};
22use crate :: { abi:: HEVMCalls , executor:: backend:: DatabaseExt , utils:: h160_to_b160} ;
33use ethers:: {
44 abi:: { AbiDecode , RawLog } ,
5+ contract:: Lazy ,
56 types:: { Address , Bytes , H160 , U256 } ,
67} ;
78use foundry_utils:: error:: { ERROR_PREFIX , REVERT_PREFIX } ;
@@ -16,9 +17,9 @@ use std::cmp::Ordering;
1617/// Solidity will see a successful call and attempt to decode the return data. Therefore, we need
1718/// to populate the return with dummy bytes so the decode doesn't fail.
1819///
19- /// 512 bytes was arbitrarily chosen because it is long enough for return values up to 16 words in
20+ /// 8912 bytes was arbitrarily chosen because it is long enough for return values up to 256 words in
2021/// size.
21- static DUMMY_CALL_OUTPUT : [ u8 ; 1024 ] = [ 0u8 ; 1024 ] ;
22+ static DUMMY_CALL_OUTPUT : Lazy < Bytes > = Lazy :: new ( || Bytes :: from_static ( & [ 0u8 ; 8192 ] ) ) ;
2223
2324/// Same reasoning as [DUMMY_CALL_OUTPUT], but for creates.
2425static DUMMY_CREATE_ADDRESS : Address =
@@ -58,7 +59,7 @@ pub fn handle_expect_revert(
5859 ( Some ( DUMMY_CREATE_ADDRESS ) , Bytes :: new( ) )
5960 } else {
6061 trace!( "successfully handled expected revert" ) ;
61- ( None , DUMMY_CALL_OUTPUT . to_vec ( ) . into ( ) )
62+ ( None , DUMMY_CALL_OUTPUT . clone ( ) )
6263 } )
6364 } ;
6465 }
0 commit comments