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
fmtconfiguration. - A
default,lite,rpc_endpoints,etherscanprofiles 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 theirsetUpmethod. 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
describeblock to unit test a function, e.g.contract Incrementto test theincrementfunction.
Note:
-
You need to set the
ETHERSCAN_API_KEYenvironment variable to your Etherscan API key andPRIVATE_KEYto 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 --verifyforge script script/Deploy.s.sol --rpc-url 5ireMainnet src/Counter.sol:Counter --legacy --broadcast --verify