Foundry
Last updated
Last updated
is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry consists of:
: Ethereum testing framework (like Truffle, Hardhat and DappTools).
: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
: Local Ethereum node, akin to Ganache, Hardhat Network.
: Fast, utilitarian, and verbose solidity REPL.
Install Foundry
Linux or MaxOS
Windows
Create a project
Navigate to the Source in the project and create your smart contract
Input your smart contract or use the sample contract below.
Install OpenZeppelin contracts as a dependency
Compile contract
Deploying a contract with Forge is a simple process that can be done with a single command. However, it requires an RPC endpoint, a private key that has funds, and any arguments for the constructor of the contract.
For example, the MyToken.sol
contract requires an initial supply of tokens to be specified in its constructor, so the command to deploy it on a network will include the argument of 100.
To deploy the MyToken.sol
contract, use the command that corresponds to the Mint chain’s RPC URL while running the forge create
command: