Skip to content

Commit

Permalink
doc: Add note for touch accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
drklee3 committed Apr 18, 2024
1 parent 6f2f235 commit 2c29bb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/evm/statedb/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ func (s *stateObject) touch() {
func (s *stateObject) AddBalance(amount *big.Int) {
// EIP161: We must check emptiness for the objects such that the account
// clearing (0,0,0 objects) can take effect.

// The only state changes that can actually result in an empty account are
// transactions, e.g. CALL, SUICIDE, with zero value transferred to this
// account, so this is the only area where the account marked as touched.
// See: EIP-161 Notes - https://eips.ethereum.org/EIPS/eip-161
if amount.Sign() == 0 {
if s.empty() {
s.touch()
Expand Down

0 comments on commit 2c29bb1

Please sign in to comment.