Skip to content

clober-dex/sst-simulate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This repository contains configuration and scripts for simulating SST behavior on a local Anvil node using Foundry.

Start a local Anvil node

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"

Build contracts

Compile the contracts with:

forge build

Deploy contracts

Deploy the contracts using the following script:

forge script ./test/Simulate.t.sol:SimulateTest --sig "deploy()" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url localhost:8545 --broadcast

Copy the deployed contract address from the output for use in the next steps.

Fill SST

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 --broadcast

Remove SST

Run 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 --broadcast

Count non-empty storage slots

To check how many storage slots currently contain data for the given contract address, run:

bash script/count_storage.sh <address>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published