Skip to content

don't allow setting state variables in a templates _build function #1005

Description

@blmalone

Discussed here.

good safety feature to track is to assert this. Implementation could be something like:

vm.dumpState() -> filter for storage in address(this)
do the build method
dump state again after build and keccak256(initStateOfThis)) == keccak256(endStateOfThis)

Essentially, if _build tries to set any state variables, they will be reverted before _validate runs. This behavior is unintuitive and potentially unsafe. It occurs because we revert to the previous snapshot after _build completes. See this line.

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