Skip to content

feat(cheatcodes): add vm.storeTransient and vm.loadTransient #8165

@0xteddybear

Description

@0xteddybear

Component

Forge

Describe the feature you would like

A cheatcode that sets a contract's transient storage slot to a particular value, and another one allowing to read it

Additional context

It'd be consistent to have methods to read/write transient storage similar to those that already perform those operations on regular storage

They are useful for mocks & unit testing of contracts using transient storage, and would be extra useful given there are currently no solidity variables of transient type and that makes it more cumbersome to write mocks by hand or with automated mocking tools such as smock-foundry

Setting the transient storage slot from outside the contract enables devs to do less mocking

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Next Up

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions