ityfuzz
ityfuzz copied to clipboard
Fix callee onchain balance
trafficstars
Hello, this pull request fixes a problem with initial balance when making a call.
self.next_slot will contain the actual balance of the receiver address only if there was a prior execution of the BALANCE opcode. In the call() handler the balance of the never seen receiver address is not initialized (self.next_slot is 0). In this patch if the address' balance was never queried we obtain the balance using Onchain middleware. This fixed a reentrancy test case for me. Not sure if this way of calling the middleware is elegant enough though.