This is sample Foundry project deploying contracts through a Foundry script Counter.s.sol.
Explore the Foundry CI setup guide for more details.
For verification process to work, your foundry.toml
should be configured for the custom Virtual TestNet chain.
Extend your foundry.toml
with the following placeholder-configuration.
[etherscan]
unknown_chain = { key = "${TENDERLY_ACCESS_KEY}", chain = 0, url = "${TENDERLY_FOUNDRY_VERIFICATION_URL}" }
For local development, use proper values:
- replace TENDERLY_ACCESS_KEY with Tenderly API key
- set
chain
to your selected chain ID - replace
TENDERLY_FOUNDRY_VERIFICATION_URL
with $TENDERLY_VIRTUAL_TESTNET_RPC_URL/verify/etherscan
For CI, you can use fixtures with helper functions that will populate the placeholder values (step 1) with proper ones.
- Add the
load-fixtures.sh
file to your code-base - Add a step to
Setup Verification and Fund EOA
. The environment variables are populated by the action.
- name: Setup Verification and Fund EOA on Base
run: |
source ../../fixtures/load-fixtures.sh
update_foundry_config_and_build $TENDERLY_ACCESS_KEY $TENDERLY_FOUNDRY_VERIFICATION_URL_8453 $TENDERLY_CHAIN_ID_8453
set_wallet_balance $TENDERLY_ADMIN_RPC_URL_8453 ${{ vars.DEPLOYER_WALLET_ADDRESS }} $HUNDRED_ETH