From 134c582fc935e226d1b93381a3d5a0f267fc62b5 Mon Sep 17 00:00:00 2001 From: Garo Sanchez Date: Sat, 28 Dec 2024 22:43:46 -0600 Subject: [PATCH] Base notes --- base/Notes.md | 15 -------- base/README.md | 16 ++++++++- base/development_with_hardhat.md | 62 ++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 16 deletions(-) delete mode 100644 base/Notes.md diff --git a/base/Notes.md b/base/Notes.md deleted file mode 100644 index ce40917..0000000 --- a/base/Notes.md +++ /dev/null @@ -1,15 +0,0 @@ -# 🔵⚪ Base Learn - -## 📄 Table of Contents - -- Learn to Build Smart Contracts and Onchain Apps. -- Introduction to Ethereum [Notes here](./intro_to_ethereum.md) -- Development with Hardhat [Notes here](./development_with_hardhat.md) -- Development with Foundry [Notes here](./development_with_foundry.md) -- Smart Contract Development -- Token Development -- Hardhat Tools and Testing -- Onchain App Development (Frontend) -- Exercise Contracts - -[Page](https://docs.base.org/base-learn/docs/exercise-contracts) diff --git a/base/README.md b/base/README.md index ae504d4..81876c1 100644 --- a/base/README.md +++ b/base/README.md @@ -1,4 +1,4 @@ -# Learn to Build Smart Contracts and Onchain Apps +## 🔵⚪ Learn to Build Smart Contracts and Onchain Apps [Link](https://docs.base.org/base-learn/docs/welcome) @@ -7,6 +7,20 @@ Base Learn, your guide to learning smart contract development. For quickstarts or deeper guides: https://docs.base.org/tutorials/ +## 📄 Table of Contents + +- Learn to Build Smart Contracts and Onchain Apps. +- Introduction to Ethereum [Notes here](./intro_to_ethereum.md) +- Development with Hardhat [Notes here](./development_with_hardhat.md) +- Development with Foundry [Notes here](./development_with_foundry.md) +- Smart Contract Development +- Token Development +- Hardhat Tools and Testing +- Onchain App Development (Frontend) +- Exercise Contracts + +[Page](https://docs.base.org/base-learn/docs/exercise-contracts) + This program covers: - Ethereum Applications diff --git a/base/development_with_hardhat.md b/base/development_with_hardhat.md index a77009b..2b0987a 100644 --- a/base/development_with_hardhat.md +++ b/base/development_with_hardhat.md @@ -9,12 +9,74 @@ ## Hardhat Setup and Overview +yarn add --dev hardhat +npx hardhat + +`> Create a typescript project` +then ok everything + +- [Intro to basics of Hardhat here](https://docs.base.org/base-learn/docs/hardhat-setup-overview/hardhat-setup-overview-sbs) + ## Testing with Typescript +Here we will learn + +- Use TypeChain to make writing tests easier +- Write unit tests using Mocha, Chai and Hardhat Toolkit +- Set up multiple signers and call smart contract functions with different signers + +Setup Typechain + +you created a new project using the init command that by default installs @nomicfoundation/hardhat-toolbox. This package already contains Typechain, which is a plugin that generates static types for your smart contracts. + +After compiling, a new folder called typechain-types was created + ## Etherscan +Objectives: + +- List some of the features of Etherscan +- Read data from the Bored Ape Yacht Club contract on Etherscan +- Write data to a contract using Etherscan. + +One of the things you can do with Etherscan is interact with already-deployed contracts. + +This is the BAYC contract on Etherscan: https://etherscan.io/token/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d + +You are able to see information such as: + +- The ETH balance it holds +- The contract creator +- The transaction when it was created +- Latest transactions +- And the verified contract + +In the Contract tab, you can see the full source code of BAYC. + +Verifying contracts is important since it gives transparency to your users. Bear in mind this means bad actors will be able to see the source code of your contract and will try to exploit it. + ## Deploying Smart Contracts +[Link](https://docs.base.org/base-learn/docs/hardhat-deploy/hardhat-deploy-sbs): + +- Setting up Hardhat deploy +- Testing your deployment +- Deploying to a test network + ## Verifying Smart Contracts +- Verify a deployed smart contract on Etherscan +- Connect a wallet to a contract in Etherscan +- Use etherscan to interact with your own deployed contract + ## Mainnet Forking + +Objectives: + +- Use Hardhat Network to create a local fork of mainnet and deploy a contract to it +- Utilize Hardhat forking features to configure the fork for several use cases + +- Overview +- Creating the Balance Reader contract +- Configuring Hardhat to support forking +- Creating a test for the BalanceReader.sol contract