Skip to content

EIP-161: Sending zero to an empty account #3341

Description

@kevaundray

Observation

EIP-161 says:

An account is considered to be touched when it is involved in any potentially state-changing operation. This includes, but is not limited to, being the recipient of a transfer of zero value.

The specs seem to diverge from the clients and the EIP here, it seems to not be testable because empty accounts are not allowed in the pre-state.

Expectation

I would have expected that when we transfer 0 to an account, that there would be some check like:

if account_exists_and_is_empty(tx_state, target): destroy_account(...)

or

modify_state(..., lambda _: None) 

To signal the account has been touched and should be removed.

The code currently checks for value != 0 when sending, so without such checks we would not mark an account as touched.

(Not sure about removing the value != 0 check since that potentially affects BAL)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions