Last updated for Spring 2023.
We want to ramp up new developers to be able to meaningfully contribute to EVM projects.
Goals:
- Become familiar with EVM development workflow
- Get familiar with the most important EVM concepts
- Implement some smart contracts with Solidity
- Write some client code to interact with smart contracts
Day 1
- EVM Overview
- Development Exercises
- Ex 0: Make and merge a PR into an Illini Blockchain repo!
- Ex 1: Hardhat quick start
- Ex 2: Deploy to Goerli and verify contract
- Use
.env
file instead of suggested method in tutorial
- Use
- Ex 3: Deploy a basic counter smart contract and access it from a basic front end!
Steps for Ex 3:
-
Create a new hardhat project under the directory 'my-counter'
-
Configure your .env file and hardat.config file like before - make sure the wallet you are using has some test eth
-
Delete the existing smart contracts in the smart contracts folder
-
Create a basic counter smart contract.
- It should have 1 global state variable
count
and 2 public functions, one to increment, and one to get the count. - Maybe write some test cases in the run.js folder?
- It should have 1 global state variable
-
Deploy to Goerli and verify your contract on etherscan. Increment the count a few times using the etherscan ui.
-
Clone the following repository and create a branch
git checkout -b <your-name-counter>
-
cd into the repository, install dependencies and start on local host
npm i npm start
-
Get the Alchemy API key from step one, you will need to use it to connect to the Georli network!
-
Head into the
App.js
folder, and make updates so that it connects to your smart contract, and sogetCount()
works -
Push your changes and make a PR.
-
All Done!
Day 2
Solidity!
- Resources
- Exercise: Implement a simplified version of ERC20!
- Create a new branch for day 2 and get the skeleton code
git checkout main git pull git checkout -b <yourname-day-2> git fetch origin day-2 git rebase origin/day-2
- Checkout the following files:
simple-token/contracts/IERC20Simple.sol
is the interface contract for our simplified token.simple-token/contracts/ERC20Simple.sol
is our implementation of our token interface.simple-token/test/ERC20Simple.js
is our file for testing our implementation.
- Implement the
_mint
,_burn
,_transfer
functions insimple-token/contracts/ERC20Simple.sol
- Note: you will need to implement
_mint
before tests for_transfer
will work!
- Note: you will need to implement
- Deploy and verify your contract on Goerli Testnet use your token contract through the Etherscan UI
- Create a new branch for day 2 and get the skeleton code
Day 3
Client side!
- Resources
- Metamask Docs
- ethers.js
- Illini Blockchain Examples
- Exercise: Implement a UI to interact with ERC20Simple (deployed here)!
- Create a new branch for day 3 and get the skeleton code
git checkout main git pull git checkout -b <yourname-day-3> git fetch origin day-3 git rebase origin/day-3
- Checkout
simple-token-app
, most notablysimple-token-app/app/src/pages/App.js
- You will need to..
- Allow your frontend to import the contract ABI
- Implement the
connectWallet
,mint
,transfer
, andburn
- Create a new branch for day 3 and get the skeleton code