Please read the full README before using this template.
This template is designed to be a simple but powerful configuration for Foundry projects, that aims to help you follow Solidity and Foundry best practices
The foundry.toml
config file comes with:
- A
fmt
configuration. - A
default
,lite
,rpc_endpoints
,etherscan
profiles for 5ireChain.
The test structure is configured to follow recommended best practices. It's strongly recommended to read that document, as it covers a range of aspects. Consequently, the test structure is as follows:
- The core protocol deploy script is
script/Deploy.sol
. This deploys the contracts and saves their addresses to storage variables. - The tests inherit from this deploy script and execute
Deploy.run()
in theirsetUp
method. This has the effect of running all tests against your deploy script, giving confidence that your deploy script is correct. - Each test contract serves as
describe
block to unit test a function, e.g.contract Increment
to test theincrement
function.
Note:
-
You need to set the
ETHERSCAN_API_KEY
environment variable to your Etherscan API key andPRIVATE_KEY
to your wallet private key. -
Make sure your wallet has enough balance to pay for the gas fees.
forge script script/Deploy.s.sol --rpc-url 5ireTestnet src/Counter.sol:Counter --legacy --broadcast --verify
forge script script/Deploy.s.sol --rpc-url 5ireMainnet src/Counter.sol:Counter --legacy --broadcast --verify