Skip to content

Commit

Permalink
Merge pull request #2 from NethermindEth/andreiburdusa/storage-erase-…
Browse files Browse the repository at this point in the history
…default-values

Erase default values from storage
  • Loading branch information
jkopanski authored Oct 7, 2024
2 parents ed98681 + 178504e commit 24aad3a
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 == 0 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 24aad3a

Please sign in to comment.