@@ -14,7 +14,10 @@ use ethers_core::{
1414 rlp:: { Decodable , DecoderError , Encodable , Rlp , RlpStream } ,
1515 } ,
1616} ;
17- use foundry_evm:: trace:: CallTraceArena ;
17+ use foundry_evm:: {
18+ trace:: CallTraceArena ,
19+ utils:: { h160_to_b160, u256_to_ru256} ,
20+ } ;
1821use revm:: {
1922 interpreter:: InstructionResult ,
2023 primitives:: { CreateScheme , TransactTo , TxEnv } ,
@@ -1185,7 +1188,7 @@ impl PendingTransaction {
11851188 pub fn to_revm_tx_env ( & self ) -> TxEnv {
11861189 fn transact_to ( kind : & TransactionKind ) -> TransactTo {
11871190 match kind {
1188- TransactionKind :: Call ( c) => TransactTo :: Call ( ( * c) . into ( ) ) ,
1191+ TransactionKind :: Call ( c) => TransactTo :: Call ( h160_to_b160 ( * c) ) ,
11891192 TransactionKind :: Create => TransactTo :: Create ( CreateScheme :: Create ) ,
11901193 }
11911194 }
@@ -1196,13 +1199,13 @@ impl PendingTransaction {
11961199 let chain_id = tx. chain_id ( ) ;
11971200 let LegacyTransaction { nonce, gas_price, gas_limit, value, kind, input, .. } = tx;
11981201 TxEnv {
1199- caller : caller . into ( ) ,
1202+ caller : h160_to_b160 ( caller ) ,
12001203 transact_to : transact_to ( kind) ,
1201- data : input. 0 . clone ( ) ,
1204+ data : alloy_primitives :: Bytes ( input. 0 . clone ( ) ) ,
12021205 chain_id,
12031206 nonce : Some ( nonce. as_u64 ( ) ) ,
1204- value : ( * value) . into ( ) ,
1205- gas_price : ( * gas_price) . into ( ) ,
1207+ value : u256_to_ru256 ( * value) ,
1208+ gas_price : u256_to_ru256 ( * gas_price) ,
12061209 gas_priority_fee : None ,
12071210 gas_limit : gas_limit. as_u64 ( ) ,
12081211 access_list : vec ! [ ] ,
@@ -1221,13 +1224,13 @@ impl PendingTransaction {
12211224 ..
12221225 } = tx;
12231226 TxEnv {
1224- caller : caller . into ( ) ,
1227+ caller : h160_to_b160 ( caller ) ,
12251228 transact_to : transact_to ( kind) ,
1226- data : input. 0 . clone ( ) ,
1229+ data : alloy_primitives :: Bytes ( input. 0 . clone ( ) ) ,
12271230 chain_id : Some ( * chain_id) ,
12281231 nonce : Some ( nonce. as_u64 ( ) ) ,
1229- value : ( * value) . into ( ) ,
1230- gas_price : ( * gas_price) . into ( ) ,
1232+ value : u256_to_ru256 ( * value) ,
1233+ gas_price : u256_to_ru256 ( * gas_price) ,
12311234 gas_priority_fee : None ,
12321235 gas_limit : gas_limit. as_u64 ( ) ,
12331236 access_list : to_revm_access_list ( access_list. 0 . clone ( ) ) ,
@@ -1247,14 +1250,14 @@ impl PendingTransaction {
12471250 ..
12481251 } = tx;
12491252 TxEnv {
1250- caller : caller . into ( ) ,
1253+ caller : h160_to_b160 ( caller ) ,
12511254 transact_to : transact_to ( kind) ,
1252- data : input. 0 . clone ( ) ,
1255+ data : alloy_primitives :: Bytes ( input. 0 . clone ( ) ) ,
12531256 chain_id : Some ( * chain_id) ,
12541257 nonce : Some ( nonce. as_u64 ( ) ) ,
1255- value : ( * value) . into ( ) ,
1256- gas_price : ( * max_fee_per_gas) . into ( ) ,
1257- gas_priority_fee : Some ( ( * max_priority_fee_per_gas) . into ( ) ) ,
1258+ value : u256_to_ru256 ( * value) ,
1259+ gas_price : u256_to_ru256 ( * max_fee_per_gas) ,
1260+ gas_priority_fee : Some ( u256_to_ru256 ( * max_priority_fee_per_gas) ) ,
12581261 gas_limit : gas_limit. as_u64 ( ) ,
12591262 access_list : to_revm_access_list ( access_list. 0 . clone ( ) ) ,
12601263 }
0 commit comments