Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial nonce of created contract #30

Open
iamyulong opened this issue Nov 3, 2018 · 0 comments
Open

Initial nonce of created contract #30

iamyulong opened this issue Nov 3, 2018 · 0 comments

Comments

@iamyulong
Copy link
Contributor

Based on EIP-161

Account creation transactions and the CREATE operation SHALL, prior to the execution of the initialisation code, increment the nonce over and above its normal starting value by one.

However, in FastVM only the CREATE opcode case is covered; new accounts created by creation transactions will have an initial nonce of zero.

This should not affect normal solidity usage (contract with empty code is less common), but may end up with storage changes rollback for some edge cases. In the following example, the storage changes will be discarded because the newly created account is considered as empty.

{
  "name": "stack_push",
  "description": "can push items to stack",
  "transactions": [
    {
      "type": "CREATE",
      "receiver": "",
      "value": "0",
      "data": {
        "raw": "7f000000000000000000000000000000010000000000000000000000000000000255"
      },
      "nrg": "1000000"
    }
  ]
}

https://github.com/aionnetwork/aion/blob/843761824132b2dfe2a6e8dbc5b755167f571718/modAion/src/org/aion/zero/db/AionRepositoryCache.java#L64-L74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant