Open Remscar opened 2 years ago
Great idea! And very straightforward. I'll get a PR out for this over the weekend.
Great idea! And very straightforward. I'll get a PR out for this over the weekend. @smartcontracts Thank you! Do you have an update on when this might get released?
Is your feature request related to a problem? Please describe. I want to be able to modify contract storage on a mock at a specific slot.
Describe the solution you'd like
.setVariable
allows me to change a variable, but in some cases (like when using Ethereum Diamonds) there is not a variable for me to set, but instead a storage slot that I need to set.Being able to do something like
.setStorageSlot(storageSlotPosition: string, value: any)
where
storageSlotPosition
would bekeccak256("diamond.standard.diamond.storage");
would be super helpful.Describe alternatives you've considered Forking the repo.
Additional context For example take this library: https://github.com/zer0-os/zDAO/blob/edfb37aec5dc3922a8f64add3560d9ffbd84944c/contracts/zdao/libraries/LibBasicVoting.sol
You'll notice there's a function
basicVotingStorage()
which returns aBasicVotingStorage
struct which is located at the storage slot position defined bybytes32 constant BASIC_VOTING_STORAGE_POSITION = keccak256("zer0.zdao.basicvoting.storage.v0");
I want to be able to modify that struct.