From f9052c6336b9b8acd6050d79bf186044a6de3c94 Mon Sep 17 00:00:00 2001 From: raz0r Date: Tue, 27 Aug 2024 18:23:23 +0300 Subject: [PATCH] fix fetching callee onchain balance --- src/evm/onchain/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/evm/onchain/mod.rs b/src/evm/onchain/mod.rs index 19c5107e..1fc207b6 100644 --- a/src/evm/onchain/mod.rs +++ b/src/evm/onchain/mod.rs @@ -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(),