Skip to content

Allow Transfer to read states #2316

@fyrchik

Description

@fyrchik

Describe the bug
ReadStates and WriteStates are currently different flags and the latter doesn't imply the former. I think this is a bit misleading, because in most cases we use WriteStates read is also needed. This can lead to behavior described here nspcc-dev/neo-go#1725 .

Solution
I can think of two of them:

  1. Make WriteStates require ReadStates (rename States to WriteStates). States is currently not used, so I think it makes sense.
  2. Replace WriteStates with States in Transfer and possibly some other methods with callbacks (deploy and update come to mind immediately).

I prefer first solution.

To Reproduce
Try to read storage in onPayment method, like here nspcc-dev/neo-go#1725

Expected behavior
onPayment executes correctly.

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