Skip to content

StdStorage Slot find does not find storage slot for short strings.  #345

Open
@rzmahmood

Description

Example contract:

contract MyContract {
   // short string as it only has 31 characters
    string public exists = "thequickbrownfoxjumpsoverthelaz";
}

Script:

contract MyScript is Script {
    using stdStorage for StdStorage;

    function run() public {
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
        vm.startBroadcast(deployerPrivateKey);

        MyContract s = new MyContract();

        uint256 slot = stdstore.target(address(s)).sig("exists()").find();
        console2.log(slot);
        vm.stopBroadcast();
    }
}

Output:

stdStorage find(StdStorage): Slot(s) not found.

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