Skip to content

Commit

Permalink
actually use pubdata diff
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed May 3, 2024
1 parent 9db9513 commit fc31aa8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/instruction_handlers/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ fn sstore(vm: &mut VirtualMachine, instruction: *const Instruction) -> Instructi

// Note, that the diff may be negative, e.g. in case the new write returns to the previous value.
let diff = (to_pay_by_user as i32) - (prepaid as i32);

// ^ This is the current pubdata price payed by user
vm.state.current_frame.total_pubdata_spent += diff;

vm.world
.insert_prepaid_for_write(vm.state.current_frame.address, key, to_pay_by_user);
Expand Down

0 comments on commit fc31aa8

Please sign in to comment.