This project is a template for developing Atlas modules using the Foundry framework.
Foundry is a blazing fast, portable, and modular toolkit for Ethereum application development written in Rust.
Foundry consists of:
- Forge: Ethereum testing framework (similar to Truffle, Hardhat, and DappTools).
- Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions, and getting chain data.
- Anvil: Local Ethereum node, akin to Ganache or Hardhat Network.
- Chisel: Fast, utilitarian, and verbose Solidity REPL.
- Install Foundry by following the official installation guide.
- Clone this repository.
- Run
forge install
to install dependencies. - Copy
.env.example
to.env
and fill in your environment variables.
Compile the smart contracts:
forge build
Run the test suite:
forge test
For more verbose output, use:
forge test -vv
Format your Solidity code:
forge fmt
Generate gas snapshots:
forge snapshot
Start a local Ethereum node:
anvil
Deploy your contracts to a network:
forge script script/Deploy.s.sol:DeployScript --rpc-url <your_rpc_url> --private-key <your_private_key>
Replace <your_rpc_url>
and <your_private_key>
with your actual RPC URL and private key.
Use Cast to interact with deployed contracts:
cast <subcommand>
For more detailed information on using Foundry, refer to the Foundry Book.
src/
: Smart contract source filestest/
: Test filesscript/
: Deployment and other scriptslib/
: Dependencies (installed via Forge)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.