(This is a starter for the Tirasimu Savings Club project. Initial code taken from Nader Dabit's tutorial - see below for URL)
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.
git clone https://github.com/jerrall/tiramisu.git[Optional] Install node version manager (nvm) if you want to be able to switch between versions of node easily
- Mac/Linux: https://github.com/nvm-sh/nvm
- Windows: https://github.com/coreybutler/nvm-windows
We are using node v16 for this project
If you want to install the standalone version of node, download here
If you want to use nvm
nvm install 16
nvm use 16cd tiramisu
npm install
# You should see node_modules\ contain stuff now
Open this folder in Visual Studio Code If you get prompted to install extensions - do it :)
cp ./example.env ./.env
nano ./env # Update all the values in here with secrets from Alchemy, Etherscan, and MetamaskTry running some of the following tasks:
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat helpAliases for the above tasks also exist in package.json npm scripts and Visual Studio code tasks (Command + Shift + P ==> Tasks)
Please add an entry to src/deployments.json The front end uses the last address in that array
To deploy to Rinkeby, run npm run hardhat:deploy:rinkeby
- Add a connection to the Arbitrum-Rinkeby network in MetaMask: https://developer.offchainlabs.com/docs/public_testnet#connecting-to-the-chain
- Make sure you are on the normal L1 Rinkeby network in Metamask
- Bridge some ETH to the Arbitrum-Rinkeby L2 (takes ~10 minutes for your deposit to show up in L2) https://bridge.arbitrum.io/
- Switch to the Arbitrum-Rinkeby L2 network in Metamask to confirm your deposit is complete (you need L2 eth to deploy)
- Then run
npm run hardhat:deploy:arbitrumRinkeby
Add the deployed contract address to the hardhat:verify:rinkeby script in package.json
Run npm run hardhat:verify:rinkeby to verify the source code
Make sure you added the etherscan API key from Discord to your .env file (which is intentionally gitignore'd)
Source should then start to appear on Etherscan
Make sure this command passes before you open a pull request
npm run checkThis will run all sorts of stuff that absolutely should pass to ensure a high quality of code
Tutorial by Nader Dabit this was taken from: https://dev.to/dabit3/the-complete-guide-to-full-stack-ethereum-development-3j13