-
First get foundry via getfoundry.sh.
-
Second run
foundryupto install the foundry toolchain. -
Now we can build the project running
forge build. -
For local development make sure to add an
.envand 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
anvilwith the--fork-urlflag and specify which chain should be forked. It is then important to matchPYTH_ADDRwith 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