This repository contains configuration and scripts for simulating SST behavior on a local Anvil node using Foundry.
Run the following command to start Anvil and persist the chain state to state.json:
anvil --disable-block-gas-limit --dump-state state.json --block-base-fee-per-gas 0 --disable-code-size-limit -m "test test test test test test test test test test test junk"Compile the contracts with:
forge buildDeploy the contracts using the following script:
forge script ./test/Simulate.t.sol:SimulateTest --sig "deploy()" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url localhost:8545 --broadcastCopy the deployed contract address from the output for use in the next steps.
Run the script below to fill SST for a given contract address:
forge script ./test/Simulate.t.sol:SimulateTest --sig "fillSST(address)" <address> --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url localhost:8545 --broadcastRun the script below to remove SST for a given contract address:
forge script ./test/Simulate.t.sol:SimulateTest --sig "removeSST(address)" <address> --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url localhost:8545 --broadcastTo check how many storage slots currently contain data for the given contract address, run:
bash script/count_storage.sh <address>