Run the following command in the root folder
forge build
Run the following command in the root folder
forge test --ffi
The
--ffi
flag is included in order to run external scripts our code needs to access.
Currently, verification is via foundry script can be buggy. see this issue foundry-rs/foundry#7466
Very important to have set etherscan params in foundry.toml
. See this link for more. Quick tip foundry.toml
can also reference .env
vars.
There are two options to deploy and verify
- forge create
- forge script
This approach has the disadvantage that constructor args have to be submitted via CLI.
make deploy-v1
make deploy-v1-with-script ARGS="--network tenderly"
Note that even with a response like that ...
Encountered an error verifying this contract:
Response: `NOTOK`
Details: `{"id":"df818a97-2afc-4776-b3e7-d17da61610b7","msg":"not found","slug":"not_found"}`
make: *** [deploy-v1-with-script] Error 1
The verification most presumably worked.
First deploy the v1 token contract, like seen before
make deploy-v1-with-script ARGS="--network tenderly"
Important: Now, before running the next command, you'll need to update the _implementation
variable in the script/deployProxy.s.sol
script with your deployed smart contract address (e.g., token address) from the previous step.
Then, deploy the proxy through the following command
make deploy-proxy-with-script ARGS="--network tenderly"
Find a guide here.
Set up a new foundry project.
In terminal within the project's root folder, run the command:
forge install foundry-rs/forge-std
forge install OpenZeppelin/openzeppelin-contracts --no-commit
forge install OpenZeppelin/openzeppelin-foundry-upgrades --no-commit
forge install OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
Add the following lines to the remappings.txt
file:
@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
For deployment on test or mainnet, define the "RPC_ENDPOINT_URL" in foundry.toml
and "PRIVATE_KEY" in the .env
files.