Implementation of solutions to the exercises of the Base Camp.
This codebase uses Foundry, a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Set up your preferred wallet (eg. Coinbase Wallet), enable the Base Goerli Testnet and fund your Ethereum address with test ETH (eg. using the Bware Labs Base Faucet).
In the Solidity compiler settings check the Auto compile checkbox.
One simple but manual approach to deploying contracts to a network consists of the following steps:
- Navigate to the official Remix IDE website: https://remix.ethereum.org/
- Create a new workspace using the
Basictemplate and name it as desired (eg.base-camp) - Add a new file under the
contractsdirectory with the name of the contract you're looking to deploy (eg.BasicMath.sol) - Select
Injected Providerand make sure that Base Görli network is selected - Select the contract you're looking to deploy in the
CONTRACTdropdown - Hit the deploy button (after configuring any deployment options that may be needed for your contract)
After deploying a contract,
- Copy the address of the deployed contract (eg. hit the
Copybutton under theDeployed Contractssection on theDeploy and run transactionspanel in the Remix IDE) - Navigate to Base Scan:
https://goerli.basescan.org/address/<contract address here> - Click on the
Contracttab - Click on
Verify & Publishand follow the steps
- Navigate to the exercise page (eg. Control Structures Exercise)
- Hit the
Connectbutton to connect your desired wallet. This does not have to be the same wallet or used to deploy the contract, it can be any of your wallets. Make sure to select the Base Görli network in your wallet. - Paste the address of the contract you're looking to submit in the
Contract addressinput field - Hit the
Submitbutton and confirm in your wallet
Foundry consists of:
- Forge: Ethereum testing framework (like 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, Hardhat Network.
- Chisel: Fast, utilitarian, and verbose solidity REPL.
$ forge build$ forge test$ forge fmt$ forge snapshot$ anvil$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>$ cast <subcommand>$ forge --help
$ anvil --help
$ cast --help