Skip to content

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

@blmalone

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.

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