mkdir hardhat-tutorial
cd hardhat-tutorial
yarn init
yarn add --dev hardhat
npx hardhat
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
Try running some of the following tasks:
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.ts
npx hardhat compile
npx hardhat test
# or
yarn hardhat test
# or test one of tests
yarn hardhat test test/Token.js
# default is hardhat network
yarn hardhat run scripts/deploy.js
# select other networks
yarn hardhat run scripts/deploy.js --network ganache
yarn hardhat run scripts/1.deploy_box.ts --network ganache
yarn hardhat test test/Token_v2.js test/xxxxx
yarn hardhat test ./test/xxxxx.test.ts --network hardhat
- hardhat tutorial
- Web3 Tutorial: write upgradeable smart contract (proxy) using OpenZeppelin
- Writing Upgradeable Contracts
-
- token
-
- upgradeable smart contract
- defi by example
- GitHub of defi by example
- Public Bug Report: Uniswap's SwapRouter doesn't refund unspent ETH in partial swaps
1 - Learn how to create Merkle Trees for large airdrops (1-2 hours) 2 - Learn how Ethereum nodes store data and executes smart contracts (1-2 hours) 3 - Borrow a loan worth millions in crypto without paying a single cent using Aave Flash Loans (2-4 hours) 4 - Learn about the Re-Entrancy attack - that cost $60 million (1-2 hours) 5 - Read private data from smart contracts (not really private after all) (1-2 hours) 6 - Learn about delegatecall attacks - where one contract can change data in another (2-3 hours) 7 - Why you should never generate random numbers on-chain without an oracle (1-2 hours) 8 - How to prevent users from accessing a smart contract (1-2 hours) 9 - Why not to use tx.origin to determine the sender of a transaction (1-2 hours) 10 - Detect legit-looking contracts which are actually malicious (1-2 hours) 11 - Build smart contracts that can be upgraded over time (2-3 hours) 12 - Optimize your smart contracts to build the cheapest transactions possible (30-60 minutes) 13 - Pay for someone else's transactions gas fee using meta transactions (1-2 hours) 14 - How can miners make the blockchain play in their favor through slight adjustments (1-2 hours) 15 - Bribe miners to have them play by your rules (1-2 hours)