Skip to content

Commit

Permalink
Erase default values from storage
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiburdusa committed Aug 29, 2024
1 parent f985ea6 commit 3b78768
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Clear/EVMState.lean
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def Account.lookupStorage (act : Account) (k : UInt256) : UInt256 :=
| _ => 0

def Account.updateStorage (act : Account) (k v : UInt256) : Account :=
{act with storage := Finmap.insert k v act.storage}
if v == default then
{ act with storage := act.storage.erase k }
else
{ act with storage := Finmap.insert k v act.storage}

-- definition of the machine state

Expand Down

0 comments on commit 3b78768

Please sign in to comment.