-
First get foundry via getfoundry.sh.
-
Second run
foundryup
to install the foundry toolchain. -
Now we can build the project running
forge build
. -
For local development make sure to add an
.env
and add the following env vars:
RPC_URL=http://localhost:8545/
PRIVATE_KEY=my-priv-key
PUBLIC_ADDR=my-pub-key
PYTH_ADDR=pyth-addr
- run
anvil
with the--fork-url
flag and specify which chain should be forked. It is then important to matchPYTH_ADDR
with the actual address on the forked chain.
You can run foundry tests with forge test
.
You can optionally log state for simulation tests with LOG_SIMULATION=true forge test
start anvil with anvil --dump-state 'state/deployment.state'
run deployment script with './deploy-local.sh', make sure to have a .env file.
Next time, you can load the deployment in you anvil with anvil --load-state 'state/deployment.state'
You can get the addresses from deployments/addresses.ts