Skip to content

Commit

Permalink
fix fetching callee onchain balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Raz0r committed Sep 17, 2024
1 parent 6b1c2d8 commit f1f28cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/evm/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ use crate::{
onchain::{
abi_decompiler::fetch_abi_evmole,
flashloan::{register_borrow_txn, Flashloan},
OnChain,
},
types::{as_u64, generate_random_address, is_zero, EVMAddress, EVMU256},
vm::{is_reverted_or_control_leak, EVMState, SinglePostExecution, IN_DEPLOY, IS_FAST_CALL_STATIC},
Expand Down
5 changes: 3 additions & 2 deletions src/evm/onchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,14 @@ where
let address = match *interp.instruction_pointer {
0xf1 | 0xf2 => {
// CALL | CALLCODE
let calee = interp.stack.peek(1).unwrap();
#[cfg(feature = "real_balance")]
{
// Get balance of the callee
host.next_slot = self.endpoint.get_balance(caller);
host.next_slot = self.endpoint.get_balance(convert_u256_to_h160(calee));
}

interp.stack.peek(1).unwrap()
calee
}
0xf4 | 0xfa => interp.stack.peek(1).unwrap(),
0x3b | 0x3c | 0x3f => interp.stack.peek(0).unwrap(),
Expand Down

0 comments on commit f1f28cf

Please sign in to comment.