Skip to content

Integrate symbolic storage generation script into a Kontrol command #905

@palinatolmach

Description

@palinatolmach

We should integrate the symbolic storage generation functionality developed by @lucasmt into Kontrol as a separate command.

Specifically, this python script reads the storage layout of a contract in JSON format and automatically generates a Solidity file with constants indicating the storage slot and offset for each storage variable. The files it generates look like this, and this shell script exemplifies how to use it.

This is very useful when we need to setup the contract storage with symbolic variables and other cases where we need to use the load and store cheatcodes, because it means that instead of hardcoding the slots and offsets we can just use the constants, and if the storage layout changes and variables get moved around, we just need to re-run the script to update the values.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions