Skip to content

Commit

Permalink
Fix SELFDESTRUCT incorrect account zeroing & missing beneficiary bala…
Browse files Browse the repository at this point in the history
…nce in witness (#378)

* fix SELFDESTRUCT witness recording

Signed-off-by: Ignacio Hagopian <[email protected]>

* add selfdestruct tests

Signed-off-by: Ignacio Hagopian <[email protected]>

* solve lint nit

Signed-off-by: Ignacio Hagopian <[email protected]>

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign authored Feb 16, 2024
1 parent a2cce69 commit 5f05456
Show file tree
Hide file tree
Showing 5 changed files with 513 additions and 22 deletions.
8 changes: 8 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,14 @@ func (s *StateDB) Selfdestruct6780(addr common.Address) {
}
}

func (s *StateDB) WasCreatedInCurrentTx(addr common.Address) bool {
stateObject := s.getStateObject(addr)
if stateObject == nil {
return false
}
return stateObject.created
}

// SetTransientState sets transient storage for a given account. It
// adds the change to the journal so that it can be rolled back
// to its previous value if there is a revert.
Expand Down
Loading

0 comments on commit 5f05456

Please sign in to comment.