├── section-5 ├── ether-wallet-dapp-initial │ ├── test │ │ └── EtherWallet.js │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── images │ │ │ └── hand.svg │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── reportWebVitals.js │ │ ├── index.js │ │ ├── App.js │ │ └── App.css │ ├── README.md │ ├── hardhat.config.js │ ├── .gitignore │ ├── scripts │ │ └── deploy.js │ ├── package.json │ └── contracts │ │ └── EtherWallet.sol ├── ether-wallet-dapp-complete │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── images │ │ │ └── hand.svg │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── reportWebVitals.js │ │ ├── index.js │ │ └── App.css │ ├── README.md │ ├── .gitignore │ ├── scripts │ │ └── deploy.js │ ├── hardhat.config.js │ ├── package.json │ └── contracts │ │ └── EtherWallet.sol └── ether-wallet-dapp-exercise-solution │ ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── images │ │ └── hand.svg │ ├── src │ ├── setupTests.js │ ├── App.test.js │ ├── index.css │ ├── reportWebVitals.js │ ├── index.js │ └── App.css │ ├── README.md │ ├── .gitignore │ ├── scripts │ └── deploy.js │ ├── hardhat.config.js │ ├── package.json │ └── contracts │ └── EtherWallet.sol ├── section-10 ├── lecture-4 │ └── smart-staking-wallet │ │ ├── .env.example │ │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ └── manifest.json │ │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── reportWebVitals.js │ │ ├── Wallet.js │ │ ├── App.css │ │ └── components │ │ │ ├── WalletBalance.js │ │ │ └── StakedBalance.js │ │ ├── README.md │ │ ├── .gitignore │ │ ├── scripts │ │ └── deploy.js │ │ ├── package.json │ │ └── contracts │ │ └── Wallet.sol ├── smart-staking-wallet-complete │ ├── .env.example │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ └── manifest.json │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── reportWebVitals.js │ │ ├── Wallet.js │ │ ├── App.css │ │ └── components │ │ │ ├── WalletBalance.js │ │ │ └── StakedBalance.js │ ├── README.md │ ├── .gitignore │ ├── scripts │ │ └── deploy.js │ ├── package.json │ └── contracts │ │ └── Wallet.sol ├── lecture-3 │ ├── .gitignore │ ├── package.json │ ├── README.md │ ├── hardhat.config.js │ ├── scripts │ │ └── deploy.js │ └── contracts │ │ └── Wallet.sol └── lecture-2 │ └── Wallet.sol ├── section-7 ├── ether-wallet-dapp-rainbowkit │ ├── .env.example │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ └── manifest.json │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── reportWebVitals.js │ │ └── App.css │ ├── README.md │ ├── .gitignore │ ├── scripts │ │ └── deploy.js │ ├── package.json │ ├── contracts │ │ └── EtherWallet.sol │ └── hardhat.config.js └── ether-wallet-dapp-rainbowkit-exercise-solution │ ├── .env.example │ ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ └── manifest.json │ ├── src │ ├── setupTests.js │ ├── App.test.js │ ├── reportWebVitals.js │ └── App.css │ ├── README.md │ ├── .gitignore │ ├── scripts │ └── deploy.js │ ├── package.json │ ├── contracts │ └── EtherWallet.sol │ └── hardhat.config.js ├── section-8 ├── lecture-7 │ └── multisigwallet-dapp │ │ ├── .env.example │ │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ └── manifest.json │ │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── reportWebVitals.js │ │ └── App.css │ │ ├── README.md │ │ ├── .gitignore │ │ ├── hardhat.config.js │ │ ├── scripts │ │ └── deploy.js │ │ └── package.json ├── multisigwallet-dapp-complete │ ├── .env.example │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ └── manifest.json │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── reportWebVitals.js │ │ └── App.css │ ├── README.md │ ├── .gitignore │ ├── hardhat.config.js │ ├── scripts │ │ └── deploy.js │ └── package.json ├── lecture-6 │ └── multisigwallet-dapp │ │ ├── public │ │ ├── robots.txt │ │ ├── favicon.ico │ │ ├── logo192.png │ │ ├── logo512.png │ │ └── manifest.json │ │ ├── src │ │ ├── setupTests.js │ │ ├── App.test.js │ │ ├── index.css │ │ ├── reportWebVitals.js │ │ ├── index.js │ │ ├── App.js │ │ └── App.css │ │ ├── README.md │ │ ├── .gitignore │ │ ├── hardhat.config.js │ │ ├── scripts │ │ └── deploy.js │ │ └── package.json ├── lecture-5 │ └── 1_Exercise.sol └── lecture-3 │ └── 1_Exercise.sol ├── section-6 ├── lecture-2 │ ├── events-in-hardhat │ │ ├── .gitignore │ │ ├── package.json │ │ ├── .env.example │ │ ├── README.md │ │ ├── hardhat.config.js │ │ ├── test │ │ │ └── SimpleStorage.test.js │ │ ├── contracts │ │ │ └── SimpleStorage.sol │ │ └── scripts │ │ │ └── deploy.js │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_Events.sol ├── lecture-11 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_ContractToCreateOtherContract.sol ├── lecture-4 │ ├── 2_Exercise.sol │ └── 3_Solution.sol ├── lecture-3 │ ├── 2_Exercise.sol │ └── 3_Solution.sol ├── lecture-5 │ ├── 1_AbstractContract.sol │ ├── 2_Interfaces.sol │ ├── 3_Exercise.sol │ └── 4_Solution.sol ├── lecture-7 │ ├── 2_Exercise.sol │ ├── 1_UsingFor.sol │ └── 3_Solution.sol ├── lecture-10 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_CallingOtherContracts.sol ├── lecture-6 │ └── 1_Libraries.sol ├── lecture-12 │ └── 1_StringsAndBytes.sol └── lecture-8 │ └── 2_Exercise.sol ├── section-3 ├── lecture-13 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_FuncModifier.sol ├── lecture-18 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_Errors.sol ├── lecture-16 │ ├── 2_Exercise.sol │ └── 3_Solution.sol ├── lecture-5 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_SimpleContract.sol ├── lecture-11 │ ├── 2_Exercise.sol │ └── 3_Solution.sol ├── lecture-9 │ ├── 2_Exercise.sol │ └── 3_Solution.sol ├── lecture-7 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_BuiltinVarsAndFuncs.sol ├── lecture-17 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_Mapping.sol ├── lecture-10 │ ├── 3_Solution.sol │ ├── 2_Exercise.sol │ └── 1_ScopingAndDeclaration.sol ├── lecture-8 │ ├── 1_Constructor.sol │ ├── 3_Solution.sol │ └── 2_Exercise.sol ├── lecture-4 │ └── 1_Structure.sol ├── lecture-14 │ ├── 3_Solution.sol │ ├── 2_Exercise.sol │ └── 1_DataLocation.sol ├── lecture-15 │ ├── 2_Exercise.sol │ ├── 3_Solution.sol │ └── 1_Arrays.sol └── lecture-12 │ └── 1_Visibility.sol ├── section-2 └── lecture-9 │ └── 1_HelloWorld.sol ├── section-9 ├── lecture-9 │ └── 1_ERC721.sol ├── lecture-2 │ └── 1_ERC20.sol ├── lecture-12 │ ├── 3_ERC721Burnable.sol │ ├── 2_ERC721Pausable.sol │ └── 1_ERC721Enumerable.sol ├── lecture-6 │ ├── 2_ERC20Capped.sol │ ├── 1_ERC20Burnable.sol │ ├── 4_ERC20FlashMint.sol │ ├── 5_ERC20Permit.sol │ ├── 6_ERC20SafeERC20.sol │ └── 3_ERC20Pausable.sol ├── lecture-19 │ └── 1_Counters.sol ├── lecture-8 │ └── 1_ERC777.sol ├── lecture-16 │ └── 1_Ownable.sol └── lecture-15 │ └── 1_ERC1155.sol ├── README.md └── section-4 └── lecture-1 ├── 3_Solution.sol ├── 2_Exercise.sol └── 1_EtherWallet.sol /section-5/ether-wallet-dapp-initial/test/EtherWallet.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/.env.example: -------------------------------------------------------------------------------- 1 | ALCHEMY_KEY="Alchemy_key" 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/.env.example: -------------------------------------------------------------------------------- 1 | ALCHEMY_KEY="Alchemy_key" 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/.env.example: -------------------------------------------------------------------------------- 1 | ALCHEMY_KEY="Alchemy_key" 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/.env.example: -------------------------------------------------------------------------------- 1 | ALCHEMY_KEY="Alchemy_key" 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/.env.example: -------------------------------------------------------------------------------- 1 | ALCHEMY_KEY="Alchemy_key" 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/.env.example: -------------------------------------------------------------------------------- 1 | ALCHEMY_KEY="Alchemy_key" 2 | GENERATE_SOURCEMAP=false -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-complete/public/favicon.ico -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-complete/public/logo192.png -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-complete/public/logo512.png -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-initial/public/favicon.ico -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-initial/public/logo192.png -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-initial/public/logo512.png -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-7/ether-wallet-dapp-rainbowkit/public/favicon.ico -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-7/ether-wallet-dapp-rainbowkit/public/logo192.png -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-7/ether-wallet-dapp-rainbowkit/public/logo512.png -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/lecture-6/multisigwallet-dapp/public/favicon.ico -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/lecture-6/multisigwallet-dapp/public/logo192.png -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/lecture-6/multisigwallet-dapp/public/logo512.png -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/lecture-7/multisigwallet-dapp/public/favicon.ico -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/lecture-7/multisigwallet-dapp/public/logo192.png -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/lecture-7/multisigwallet-dapp/public/logo512.png -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/multisigwallet-dapp-complete/public/favicon.ico -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/multisigwallet-dapp-complete/public/logo192.png -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-8/multisigwallet-dapp-complete/public/logo512.png -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-10/lecture-4/smart-staking-wallet/public/favicon.ico -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-10/lecture-4/smart-staking-wallet/public/logo192.png -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-10/lecture-4/smart-staking-wallet/public/logo512.png -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-10/smart-staking-wallet-complete/public/favicon.ico -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-10/smart-staking-wallet-complete/public/logo192.png -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-10/smart-staking-wallet-complete/public/logo512.png -------------------------------------------------------------------------------- /section-10/lecture-3/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain 6 | typechain-types 7 | 8 | #Hardhat files 9 | cache 10 | artifacts 11 | 12 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-exercise-solution/public/favicon.ico -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-exercise-solution/public/logo192.png -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-5/ether-wallet-dapp-exercise-solution/public/logo512.png -------------------------------------------------------------------------------- /section-6/lecture-2/events-in-hardhat/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain 6 | typechain-types 7 | 8 | #Hardhat files 9 | cache 10 | artifacts 11 | 12 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/favicon.ico -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/logo192.png -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EatTheBlocks/web3-101/HEAD/section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/logo512.png -------------------------------------------------------------------------------- /section-6/lecture-2/events-in-hardhat/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hardhat-project", 3 | "devDependencies": { 4 | "@nomicfoundation/hardhat-toolbox": "^2.0.0", 5 | "hardhat": "^2.11.2" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /section-6/lecture-2/events-in-hardhat/.env.example: -------------------------------------------------------------------------------- 1 | ETHERSCAN_API_KEY= 2 | GOERLI_RPC_URL=https://goerli.infura.io/v3/ 3 | PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 4 | -------------------------------------------------------------------------------- /section-10/lecture-3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hardhat-project", 3 | "devDependencies": { 4 | "@nomicfoundation/hardhat-toolbox": "^2.0.0", 5 | "hardhat": "^2.12.2" 6 | }, 7 | "dependencies": { 8 | "@openzeppelin/contracts": "^4.7.3" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /section-3/lecture-13/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Create a modifier function that checks that the address passed in is not the zero address. 7 | */ 8 | contract Exercise { 9 | 10 | // TODO: Create a function modifier called "validAddress" 11 | // Takes in one argument of type address 12 | 13 | } -------------------------------------------------------------------------------- /section-2/lecture-9/1_HelloWorld.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.16; 3 | 4 | contract HelloWorld { 5 | string public text; 6 | 7 | constructor() {} 8 | 9 | function setText() public { 10 | text = "Hello World"; 11 | } 12 | 13 | function getText() public view returns(string memory) { 14 | return text; 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /section-6/lecture-2/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | /* 5 | Declare an event and emit it in the given function 6 | */ 7 | contract Exercise { 8 | // TODO: Create an event called "Deposit" that logs the sender and the amount of ETH sent 9 | 10 | function deposit() public payable { 11 | // TODO: Emit the "Deposit" event here 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /section-10/lecture-3/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-6/lecture-2/events-in-hardhat/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-3/lecture-18/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | contract Exercise { 6 | uint amountRequired = 100; 7 | 8 | // Todo: Create a function called "buy" where the amount of Ether sent 9 | // has to be exactly the amount it costs to purchase the item; 10 | // You can use either the "require" or the "revert" statement 11 | function buy() public payable { 12 | 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/README.md: -------------------------------------------------------------------------------- 1 | # Sample Hardhat Project 2 | 3 | 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. 4 | 5 | Try running some of the following tasks: 6 | 7 | ```shell 8 | npx hardhat help 9 | npx hardhat test 10 | REPORT_GAS=true npx hardhat test 11 | npx hardhat node 12 | npx hardhat run scripts/deploy.js 13 | ``` 14 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/Wallet.js: -------------------------------------------------------------------------------- 1 | import { useContract, useQuery } from 'wagmi' 2 | 3 | import Staking from './artifacts/contracts/Staking.sol/Staking.json' 4 | 5 | function Wallet({ wallets }) { 6 | const contract = useContract({ 7 | address: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', 8 | abi: Staking.abi, 9 | }) 10 | 11 | const { data } = useQuery('wallet', async () => { 12 | let result = [] 13 | 14 | return result 15 | }) 16 | return <> 17 | } 18 | 19 | export default Wallet 20 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/Wallet.js: -------------------------------------------------------------------------------- 1 | import { useContract, useQuery } from 'wagmi' 2 | 3 | import Staking from './artifacts/contracts/Staking.sol/Staking.json' 4 | 5 | function Wallet({ wallets }) { 6 | const contract = useContract({ 7 | address: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', 8 | abi: Staking.abi, 9 | }) 10 | 11 | const { data } = useQuery('wallet', async () => { 12 | let result = [] 13 | 14 | return result 15 | }) 16 | return <> 17 | } 18 | 19 | export default Wallet 20 | -------------------------------------------------------------------------------- /section-3/lecture-16/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | struct Wallet { 6 | address addr; 7 | uint amount; 8 | } 9 | 10 | /* 11 | Define a struct within a struct. 12 | */ 13 | contract Exercise { 14 | 15 | /* Todo: Create a struct called "CrowdFunding" that defines the following variables: 16 | Field 1: address of type payable called "beneficiary" 17 | Field 2: unsigned integer called "numFunders" 18 | Field 3: Array of structs of type "Wallet" called "wallets" 19 | */ 20 | 21 | } -------------------------------------------------------------------------------- /section-3/lecture-5/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Create a function that takes two arguments(x and y) of type uint and returns the value for x(x + y) and 7 | store this number in a state variable. 8 | */ 9 | contract Exercise { 10 | uint storedData; // State variable 11 | 12 | // TODO: 13 | // Function calculation() 14 | // Takes two arguments of type uint 15 | // Returns the value for x(x+y) 16 | // Also stores this value x(x+y) in the state variable storedData 17 | } -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** @type import('hardhat/config').HardhatUserConfig */ 4 | module.exports = { 5 | solidity: "0.8.17", 6 | paths: { 7 | sources: './contracts', 8 | artifacts: './src/artifacts' 9 | }, 10 | defaultNetwork: 'hardhat', 11 | networks: { 12 | hardhat: { 13 | chainID: 1337 14 | }, 15 | goerli: { 16 | url: 'https://goerli-testnet-node-url.com', 17 | // accounts: [privateKey1, privateKey2] 18 | } 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | -------------------------------------------------------------------------------- /section-3/lecture-11/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Find a way to declare two variables of the same name(one state variable and anoher local variable) 7 | and set the value of local variable to whatever the value of the state variable is and return the value 8 | */ 9 | contract Exercise { 10 | uint public num; 11 | 12 | // TODO: Write a special function so that you can send Ether to the contract. 13 | 14 | // TODO: Write a special function so that you can call any function with any name if they 15 | // don't exist in the contract 16 | } -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | -------------------------------------------------------------------------------- /section-3/lecture-9/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Write a function that takes an unsigned integer x as a parameter, goes through a loop 10 times, 7 | and adds the previous value of x to itself and returns the final sum. If the value of x is 0, return 100. 8 | */ 9 | contract Exercise { 10 | // TODO: 11 | function controlStructureFunc(uint x) public pure returns(uint) { 12 | // if the value of x is 0, return 100 13 | // Loop 10 times 14 | // Add the value of x to the current value of x(basically 2 * x) 15 | // Return the sum 16 | } 17 | } -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /section-3/lecture-7/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Write a constructor that takes in 2 arguments of types uint and string and sets the state 7 | variable values to these passed-in values in the constructor. 8 | */ 9 | contract Exercise { 10 | 11 | // TODO: The function declaration may not be fully complete 12 | // HINT: Look at how to handle the type "address" 13 | function addition() public returns(uint) { 14 | // Get the block number 15 | // Get the Ether sent when calling this function 16 | // Add the two numbers together 17 | // Return the result 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/App.js: -------------------------------------------------------------------------------- 1 | import logo from './logo.svg'; 2 | import './App.css'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | logo 9 |

10 | Edit src/App.js and save to reload. 11 |

12 | 18 | Learn React 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/App.js: -------------------------------------------------------------------------------- 1 | import logo from './logo.svg'; 2 | import './App.css'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | logo 9 |

10 | Edit src/App.js and save to reload. 11 |

12 | 18 | Learn React 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/src/index.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap/dist/css/bootstrap.min.css' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom/client' 4 | import App from './App' 5 | import './index.css' 6 | import reportWebVitals from './reportWebVitals' 7 | 8 | const root = ReactDOM.createRoot(document.getElementById('root')) 9 | root.render( 10 | 11 | 12 | 13 | ) 14 | 15 | // If you want to start measuring performance in your app, pass a function 16 | // to log results (for example: reportWebVitals(console.log)) 17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 18 | reportWebVitals() 19 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/src/index.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap/dist/css/bootstrap.min.css' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom/client' 4 | import App from './App' 5 | import './index.css' 6 | import reportWebVitals from './reportWebVitals' 7 | 8 | const root = ReactDOM.createRoot(document.getElementById('root')) 9 | root.render( 10 | 11 | 12 | 13 | ) 14 | 15 | // If you want to start measuring performance in your app, pass a function 16 | // to log results (for example: reportWebVitals(console.log)) 17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 18 | reportWebVitals() 19 | -------------------------------------------------------------------------------- /section-3/lecture-17/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Create a simplified token contract to keep track of balances and declare a function 7 | to transfer these tokens from the sender to the recipient. 8 | */ 9 | contract Exercise { 10 | 11 | // TODO: Create a mapping from address to uint256 called "balances" 12 | 13 | // TODO: Create a function called "transfer" that lets the "sender" 14 | // send money to a "recipient" with the amount "amount". 15 | // Note: You do not need to deal with any external function calls to 16 | // actually send/receive Ether but rather only need to utilize the mapping 17 | // "balances" to increase/decrease the amount from there directly 18 | 19 | } -------------------------------------------------------------------------------- /section-9/lecture-9/1_ERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; 12 | 13 | contract WEB3101 is ERC721 { 14 | constructor() ERC721("Web3 101", "WEB3101") {} 15 | } 16 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | 37 | node_modules 38 | .env 39 | coverage 40 | coverage.json 41 | typechain 42 | typechain-types 43 | 44 | #Hardhat files 45 | cache 46 | artifacts 47 | 48 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | 37 | node_modules 38 | .env 39 | coverage 40 | coverage.json 41 | typechain 42 | typechain-types 43 | 44 | #Hardhat files 45 | cache 46 | artifacts 47 | 48 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | 37 | node_modules 38 | .env 39 | coverage 40 | coverage.json 41 | typechain 42 | typechain-types 43 | 44 | #Hardhat files 45 | cache 46 | artifacts 47 | 48 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-initial/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-3/lecture-13/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | modifier validAddress(address _addr) { 14 | require(_addr != address(0), "Not valid address"); 15 | _; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | 37 | node_modules 38 | .env 39 | coverage 40 | coverage.json 41 | typechain 42 | typechain-types 43 | 44 | #Hardhat files 45 | cache 46 | artifacts 47 | 48 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-exercise-solution/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | node_modules 26 | .env 27 | coverage 28 | coverage.json 29 | typechain 30 | typechain-types 31 | 32 | #Hardhat files 33 | cache 34 | artifacts 35 | 36 | 37 | node_modules 38 | .env 39 | coverage 40 | coverage.json 41 | typechain 42 | typechain-types 43 | 44 | #Hardhat files 45 | cache 46 | artifacts 47 | 48 | -------------------------------------------------------------------------------- /section-7/ether-wallet-dapp-rainbowkit-exercise-solution/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /section-3/lecture-11/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | uint public num; 14 | 15 | receive() external payable {} 16 | 17 | fallback() external payable { 18 | num = msg.value; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /section-6/lecture-2/events-in-hardhat/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** @type import('hardhat/config').HardhatUserConfig */ 4 | module.exports = { 5 | solidity: '0.8.17', 6 | paths: { 7 | sources: './contracts', 8 | artifacts: './src/artifacts', 9 | }, 10 | defaultNetwork: 'hardhat', 11 | networks: { 12 | hardhat: { 13 | chainID: 1337, 14 | }, 15 | goerli: { 16 | url: process.env.GOERLI_RPC_URL || "", 17 | accounts: 18 | process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], 19 | }, 20 | }, 21 | gasReporter: { 22 | enabled: process.env.REPORT_GAS !== undefined, 23 | currency: "USD", 24 | }, 25 | etherscan: { 26 | apiKey: process.env.ETHERSCAN_API_KEY || "", 27 | } 28 | } -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/components/WalletBalance.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react' 2 | 3 | import { useContractRead } from 'wagmi' 4 | 5 | import { ethers } from 'ethers' 6 | 7 | function WalletBalance(props) { 8 | const [balance, setBalance] = useState(0) 9 | 10 | // Get balance of ETH in the wallet 11 | const { data: dataBalance } = useContractRead({ 12 | ...props.stakingWalletContract, 13 | functionName: 'walletBalance', 14 | watch: true, 15 | args: [props.walletId], 16 | }) 17 | 18 | useEffect(() => { 19 | if (dataBalance) { 20 | const result = ethers.utils.formatEther(dataBalance) 21 | setBalance(result) 22 | } 23 | }, [dataBalance]) 24 | 25 | return <>{balance} ETH 26 | } 27 | 28 | export default WalletBalance 29 | -------------------------------------------------------------------------------- /section-3/lecture-10/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | uint public data = 30; 14 | 15 | function scoping() public view returns (uint) { 16 | uint data = data; 17 | return data; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /section-6/lecture-2/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | contract Solution { 12 | event Deposit(address indexed _from, uint _value); 13 | 14 | function deposit() public payable { 15 | emit Deposit(msg.sender, msg.value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/components/WalletBalance.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react' 2 | 3 | import { useContractRead } from 'wagmi' 4 | 5 | import { ethers } from 'ethers' 6 | 7 | function WalletBalance(props) { 8 | const [balance, setBalance] = useState(0) 9 | 10 | // Get balance of ETH in the wallet 11 | const { data: dataBalance } = useContractRead({ 12 | ...props.stakingWalletContract, 13 | functionName: 'walletBalance', 14 | watch: true, 15 | args: [props.walletId], 16 | }) 17 | 18 | useEffect(() => { 19 | if (dataBalance) { 20 | const result = ethers.utils.formatEther(dataBalance) 21 | setBalance(result) 22 | } 23 | }, [dataBalance]) 24 | 25 | return <>{balance} ETH 26 | } 27 | 28 | export default WalletBalance 29 | -------------------------------------------------------------------------------- /section-3/lecture-8/1_Constructor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.16; 10 | 11 | contract Constructor1 { 12 | string public text; 13 | 14 | constructor(string _t) { 15 | text = _t; 16 | } 17 | } 18 | 19 | contract Constructor2 { 20 | constructor() {} 21 | } 22 | -------------------------------------------------------------------------------- /section-3/lecture-8/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | int public number; 14 | string public text; 15 | 16 | constructor(string memory _t, uint _n) { 17 | text = _t; 18 | number = int(_n); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /section-10/lecture-4/smart-staking-wallet/src/components/StakedBalance.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react' 2 | 3 | import { useContractRead } from 'wagmi' 4 | 5 | import { ethers } from 'ethers' 6 | 7 | function StakedBalance(props) { 8 | const [balance, setBalance] = useState(0) 9 | 10 | // Get balance of ETH that's staked in the staking pool 11 | const { data: dataBalance } = useContractRead({ 12 | ...props.stakingWalletContract, 13 | functionName: 'currentStake', 14 | watch: true, 15 | args: [props.walletId], 16 | }) 17 | 18 | useEffect(() => { 19 | if (dataBalance) { 20 | const result = ethers.utils.formatEther(dataBalance) 21 | setBalance(result) 22 | } 23 | }, [dataBalance]) 24 | 25 | return <>{balance} ETH 26 | } 27 | 28 | export default StakedBalance 29 | -------------------------------------------------------------------------------- /section-10/smart-staking-wallet-complete/src/components/StakedBalance.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react' 2 | 3 | import { useContractRead } from 'wagmi' 4 | 5 | import { ethers } from 'ethers' 6 | 7 | function StakedBalance(props) { 8 | const [balance, setBalance] = useState(0) 9 | 10 | // Get balance of ETH that's staked in the staking pool 11 | const { data: dataBalance } = useContractRead({ 12 | ...props.stakingWalletContract, 13 | functionName: 'currentStake', 14 | watch: true, 15 | args: [props.walletId], 16 | }) 17 | 18 | useEffect(() => { 19 | if (dataBalance) { 20 | const result = ethers.utils.formatEther(dataBalance) 21 | setBalance(result) 22 | } 23 | }, [dataBalance]) 24 | 25 | return <>{balance} ETH 26 | } 27 | 28 | export default StakedBalance 29 | -------------------------------------------------------------------------------- /section-3/lecture-8/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Write a constructor that takes in 2 arguments of types uint and string and sets the state variable 7 | values to these passed-in values in the constructor. 8 | */ 9 | contract Exercise { 10 | int public number; 11 | string public text; 12 | 13 | // TODO: Pass in two parameters to the constructor 14 | // First parameter is of type string 15 | // Second parameter is of type unsigned integer 16 | constructor() { 17 | // Set the value of the first parameter to the state variable "text" 18 | // Set the value of the second parameter to the state variable "number" 19 | // Note: Pay attention to the type passed in the constructor to the type of the state variable "number" 20 | } 21 | } -------------------------------------------------------------------------------- /section-9/lecture-2/1_ERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 12 | 13 | contract WEB3101 is ERC20 { 14 | constructor(uint256 initialSupply) ERC20("Web3 101", "WEB3") { 15 | _mint(msg.sender, initialSupply); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /section-6/lecture-11/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | contract Account { 5 | address public bank; 6 | address public owner; 7 | 8 | constructor (address _owner) payable { 9 | bank = msg.sender; 10 | owner = _owner; 11 | } 12 | } 13 | 14 | contract Exercise { 15 | // TODO: Create an array of accounts of type "Account" 16 | 17 | /* 18 | TODO: Create a function called "createAccount" that creates a new account 19 | and adds this account to the array of accounts above 20 | */ 21 | function createAccount(address _owner) external payable { 22 | } 23 | 24 | // TODO: Get account info according to the address of the account 25 | function getAccountInfo(Account account) public view returns(address bank, address owner) { 26 | } 27 | } -------------------------------------------------------------------------------- /section-3/lecture-16/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | struct Wallet { 13 | address addr; 14 | uint amount; 15 | } 16 | 17 | contract Solution { 18 | struct CrowdFunding { 19 | address payable beneficiary; 20 | uint numFunders; 21 | Wallet[] wallets; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /section-3/lecture-4/1_Structure.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | // import * as stor from "contracts/1_Storage.sol"; 13 | 14 | /* 15 | This is a 16 | multi-line comment 17 | */ 18 | 19 | /// @author The EatTheBlocks Team 20 | /** 21 | @notice Introducing solidity by example 22 | @title A Hello World smart contract 23 | */ 24 | -------------------------------------------------------------------------------- /section-3/lecture-5/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | uint storedData; // State variable 14 | 15 | function calculation(uint x, uint y) public returns (uint) { 16 | uint result = x * (x + y); 17 | storedData = result; 18 | return result; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /section-6/lecture-4/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | // Defining contract 5 | contract parent { 6 | 7 | // Declaring internal 8 | // state variable 9 | uint internal sum; 10 | 11 | // Defining external function 12 | // to set value of internal 13 | // state variable sum 14 | function setValue() virtual external { 15 | uint a = 10; 16 | uint b = 20; 17 | sum = a + b; 18 | } 19 | } 20 | 21 | // Defining child contract 22 | /* 23 | Create a child contract that inherits from the above parent contract 24 | and overrides the function "setValue" whereby the value of a is 100, 25 | b is 200 so the sum of a + b would be 300. Also, implement a new 26 | function called "getValue" that returns the value of sum 27 | */ 28 | contract Exercise { 29 | } 30 | -------------------------------------------------------------------------------- /section-9/lecture-12/3_ERC721Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; 12 | import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; 13 | 14 | contract WEB3101Burnable is ERC721, ERC721Burnable { 15 | constructor() ERC721("Web3 101", "WEB3") {} 16 | } 17 | -------------------------------------------------------------------------------- /section-6/lecture-3/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | /* Declare a custom error type which is called whenever the user tries to 5 | send ETH that is less than what's required 6 | */ 7 | 8 | // TODO: Create a custom error type called "InvalidAmount". Needed `minRequired` but sent `amount` 9 | 10 | contract Exercise { 11 | mapping(address => uint) balances; 12 | uint minRequired; 13 | 14 | constructor (uint256 _minRequired) { 15 | minRequired = _minRequired; 16 | } 17 | 18 | function list() public payable { 19 | uint256 amount = msg.value; 20 | /* TODO: Check whether the amount being sent is less than the minimum required. If so, 21 | call the custom error defined above and revert the transaction 22 | */ 23 | balances[msg.sender] += amount; 24 | } 25 | } -------------------------------------------------------------------------------- /section-3/lecture-5/1_SimpleContract.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract SimpleContract { 13 | uint storedData; // State variable 14 | 15 | function getStoredData() public view returns (uint) { 16 | return storedData; 17 | } 18 | } 19 | 20 | function square(uint x) pure returns (uint) { 21 | return x * x; 22 | } 23 | -------------------------------------------------------------------------------- /section-3/lecture-10/2_Exercise.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.16; 4 | 5 | /* 6 | Write a function that takes an unsigned integer x as a parameter, goes through a loop 10 times, 7 | and adds the previous value of x to itself and returns the final sum. If the value of x is 0, return 100. 8 | */ 9 | contract Exercise { 10 | uint public data = 30; 11 | 12 | /* TODO: Find a way to declare two variables of the same name(one state variable 13 | and anoher local variable) and set the value of local variable to whatever 14 | the value of the state variable is and return the value; 15 | Note: You may get the warning "This declaration shadows an existing declaration" 16 | This is ok for this exercise but you probably won't do this in real life. 17 | */ 18 | function scoping() public returns(uint) { 19 | // TODO 20 | } 21 | } -------------------------------------------------------------------------------- /section-9/lecture-6/2_ERC20Capped.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol"; 12 | 13 | contract WEB3101Capped is ERC20Capped { 14 | constructor(uint256 initialSupply) 15 | ERC20("Web3 101", "WEB3") 16 | ERC20Capped(initialSupply) 17 | { 18 | _mint(msg.sender, initialSupply); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /section-3/lecture-17/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | mapping(address => uint256) private balances; 14 | 15 | function transfer( 16 | address sender, 17 | address recipient, 18 | uint256 amount 19 | ) internal { 20 | balances[sender] -= amount; 21 | balances[recipient] += amount; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /section-3/lecture-9/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | function controlStructureFunc(uint x) public pure returns (uint) { 14 | if (x == 0) return 100; 15 | uint result = x; 16 | uint i = 0; 17 | while (i < 10) { 18 | result += result; 19 | i++; 20 | } 21 | return result; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /section-9/lecture-6/1_ERC20Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 12 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; 13 | 14 | contract WEB3101Burnable is ERC20, ERC20Burnable { 15 | constructor(uint256 initialSupply) ERC20("Web3 101", "WEB3") { 16 | _mint(msg.sender, initialSupply); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /section-9/lecture-6/4_ERC20FlashMint.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | pragma solidity ^0.8.17; 10 | 11 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 12 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20FlashMint.sol"; 13 | 14 | contract WEB3101FlashMint is ERC20, ERC20FlashMint { 15 | constructor(uint256 initialSupply) ERC20("Web3 101", "WEB3") { 16 | _mint(msg.sender, initialSupply); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /section-10/lecture-3/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require('@nomicfoundation/hardhat-toolbox') 2 | 3 | // Replace this private key with your Goerli account private key 4 | // To export your private key from Metamask, open Metamask and 5 | // go to Account Details > Export Private Key 6 | // Beware: NEVER put real Ether into testing accounts 7 | const PRIVATE_KEY = 'private_key' 8 | const ALCHEMY_KEY = 'alchemy_key' 9 | 10 | /** @type import('hardhat/config').HardhatUserConfig */ 11 | module.exports = { 12 | solidity: '0.8.17', 13 | paths: { 14 | sources: './contracts', 15 | artifacts: './src/artifacts', 16 | }, 17 | defaultNetwork: 'hardhat', 18 | networks: { 19 | hardhat: { 20 | chainID: 1337, 21 | }, 22 | goerli: { 23 | url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}`, 24 | // TODO: Uncomment the below line after updating PRIVATE_KEY above 25 | // accounts: [PRIVATE_KEY], 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /section-8/lecture-5/1_Exercise.sol: -------------------------------------------------------------------------------- 1 | contract MultiSigWallet { 2 | // function approveWithdrawTx(uint _transactionIndex) 3 | // TODO: Create a function called "getOwners" that retrieves the list of owners of the multisig wallet 4 | /* TODO: Create a function called "getWithdrawTxCount" that retrieves the total number of 5 | withdrawal transactions for the multisig wallet 6 | */ 7 | /* TODO: Create a function called "getWithdrawTxes" that retrieves all the withdraw transactions 8 | for the multisig wallet 9 | */ 10 | /* TODO: Create a function called "getWithdrawTx" that returns the withdraw transaction details 11 | according to the transaction index in the array of withdraw transactions 12 | */ 13 | // function deposit() 14 | // receive() 15 | // TODO: Create a function called "balanceOf" that gets the current amount of ETH in the multisig wallet 16 | // modifier onlyOwner() 17 | } 18 | -------------------------------------------------------------------------------- /section-8/lecture-6/multisigwallet-dapp/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require('@nomicfoundation/hardhat-toolbox') 2 | 3 | // Replace this private key with your Goerli account private key 4 | // To export your private key from Metamask, open Metamask and 5 | // go to Account Details > Export Private Key 6 | // Beware: NEVER put real Ether into testing accounts 7 | const PRIVATE_KEY = 'private_key' 8 | const ALCHEMY_KEY = 'alchemy_key' 9 | 10 | /** @type import('hardhat/config').HardhatUserConfig */ 11 | module.exports = { 12 | solidity: '0.8.17', 13 | paths: { 14 | sources: './contracts', 15 | artifacts: './src/artifacts', 16 | }, 17 | defaultNetwork: 'hardhat', 18 | networks: { 19 | hardhat: { 20 | chainID: 1337, 21 | }, 22 | goerli: { 23 | url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}`, 24 | // TODO: Uncomment the below line after updating PRIVATE_KEY above 25 | // accounts: [PRIVATE_KEY], 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /section-8/lecture-7/multisigwallet-dapp/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require('@nomicfoundation/hardhat-toolbox') 2 | 3 | // Replace this private key with your Goerli account private key 4 | // To export your private key from Metamask, open Metamask and 5 | // go to Account Details > Export Private Key 6 | // Beware: NEVER put real Ether into testing accounts 7 | const PRIVATE_KEY = 'private_key' 8 | const ALCHEMY_KEY = 'alchemy_key' 9 | 10 | /** @type import('hardhat/config').HardhatUserConfig */ 11 | module.exports = { 12 | solidity: '0.8.17', 13 | paths: { 14 | sources: './contracts', 15 | artifacts: './src/artifacts', 16 | }, 17 | defaultNetwork: 'hardhat', 18 | networks: { 19 | hardhat: { 20 | chainID: 1337, 21 | }, 22 | goerli: { 23 | url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}`, 24 | // TODO: Uncomment the below line after updating PRIVATE_KEY above 25 | // accounts: [PRIVATE_KEY], 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /section-8/multisigwallet-dapp-complete/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require('@nomicfoundation/hardhat-toolbox') 2 | 3 | // Replace this private key with your Goerli account private key 4 | // To export your private key from Metamask, open Metamask and 5 | // go to Account Details > Export Private Key 6 | // Beware: NEVER put real Ether into testing accounts 7 | const PRIVATE_KEY = 'private_key' 8 | const ALCHEMY_KEY = 'alchemy_key' 9 | 10 | /** @type import('hardhat/config').HardhatUserConfig */ 11 | module.exports = { 12 | solidity: '0.8.17', 13 | paths: { 14 | sources: './contracts', 15 | artifacts: './src/artifacts', 16 | }, 17 | defaultNetwork: 'hardhat', 18 | networks: { 19 | hardhat: { 20 | chainID: 1337, 21 | }, 22 | goerli: { 23 | url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}`, 24 | // TODO: Uncomment the below line after updating PRIVATE_KEY above 25 | // accounts: [PRIVATE_KEY], 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /section-3/lecture-14/3_Solution.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | /* 3 | WARNING: Please note that this contract has not been audited and as such may not be feasible 4 | to deploy to the mainnet as is. The contract acts only as an example to showcase how to develop 5 | smart contracts in Solidity. It may contain vulnerabilities that are unaccounted for and as such, 6 | should not be used in real environment. Do your own diligence before deploying any smart contracts 7 | to the blockchain because once deployed, you cannot modify the contract. 8 | */ 9 | 10 | pragma solidity ^0.8.16; 11 | 12 | contract Solution { 13 | function func1(uint[] memory arr1) public pure returns (uint[] memory) { 14 | // do something with memory array 15 | return arr1; 16 | } 17 | 18 | function func2(uint[] calldata arr2) external pure returns (uint[] memory) { 19 | // do something with calldata array 20 | return arr2; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /section-5/ether-wallet-dapp-complete/scripts/deploy.js: -------------------------------------------------------------------------------- 1 | // We require the Hardhat Runtime Environment explicitly here. This is optional 2 | // but useful for running the script in a standalone fashion through `node