Skip to content

Pure modifier semantics #4

@bitbart

Description

@bitbart

Revise the semantics of TinySol so that functions declared as pure cannot read the state variables of the contract:

https://docs.soliditylang.org/en/latest/contracts.html#state-mutability

For example, in the contract:

contract C {
      uint x;
      function f() public pure returns(uint) { return (x+1); }
      function g() public { x = this.f(); }
}

any call to g must revert, since the function f reads the state variable x, and so it is not pure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions