foundry
foundry copied to clipboard
Associate `chain` parameter with RPC url in scripts
Component
Forge
Describe the feature you would like
Heyo! I'd like to be able to configure RPC urls and Etherscan API keys in the foundry.toml
file and then execute forge scripts without having to pass these values as arguments. For example, given the following configuration:
[rpc_endpoints]
mainnet = '${MAINNET_RPC}'
[etherscan]
mainnet = { key = "${ETHERSCAN_MAINNET_KEY}" }
I'd like to run just:
forge script Deploy --broadcast --verify --chain mainnet
Note that no --rpc-url
or --etherscan-key
arguments are provided, and they're unnecessary because we already have the configuration in the foundry.toml
file. Only chain
is required in this case.
Would something like that be possible? Thanks!
Additional context
No response