From 2c29bb15cb62e9736a32028adbe5086e07c0041c Mon Sep 17 00:00:00 2001 From: drklee3 Date: Thu, 18 Apr 2024 14:50:25 -0700 Subject: [PATCH] doc: Add note for touch accounts --- x/evm/statedb/state_object.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x/evm/statedb/state_object.go b/x/evm/statedb/state_object.go index e286bdc26e..bd4897b580 100644 --- a/x/evm/statedb/state_object.go +++ b/x/evm/statedb/state_object.go @@ -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()