Skip to content

Commit

Permalink
Fix balance decrease
Browse files Browse the repository at this point in the history
  • Loading branch information
maximopalopoli committed Nov 29, 2024
1 parent c9e1c88 commit e97e3b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/vm/levm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,14 @@ impl VM {
ret_size: usize,
) -> Result<OpcodeSuccess, VMError> {
let (sender_account_info, _address_was_cold) =
self.access_account(current_call_frame.msg_sender);
self.access_account(msg_sender);

if sender_account_info.balance < value {
current_call_frame.stack.push(U256::from(REVERT_FOR_CALL))?;
return Ok(OpcodeSuccess::Continue);
}

self.decrease_account_balance(current_call_frame.msg_sender, value)?;
self.decrease_account_balance(msg_sender, value)?;
self.increase_account_balance(to, value)?;

let (code_account_info, _address_was_cold) = self.access_account(code_address);
Expand Down

0 comments on commit e97e3b8

Please sign in to comment.