Skip to content

Commit fb1907f

Browse files
committed
fix fetching callee onchain balance
1 parent 6b1c2d8 commit fb1907f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/evm/onchain/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,14 @@ where
268268
let address = match *interp.instruction_pointer {
269269
0xf1 | 0xf2 => {
270270
// CALL | CALLCODE
271+
let callee = interp.stack.peek(1).unwrap();
271272
#[cfg(feature = "real_balance")]
272273
{
273274
// Get balance of the callee
274-
host.next_slot = self.endpoint.get_balance(caller);
275+
host.next_slot = self.endpoint.get_balance(convert_u256_to_h160(callee));
275276
}
276277

277-
interp.stack.peek(1).unwrap()
278+
callee
278279
}
279280
0xf4 | 0xfa => interp.stack.peek(1).unwrap(),
280281
0x3b | 0x3c | 0x3f => interp.stack.peek(0).unwrap(),

0 commit comments

Comments
 (0)