Skip to content

Commit

Permalink
Base notes
Browse files Browse the repository at this point in the history
  • Loading branch information
garosan committed Dec 29, 2024
1 parent 8464ff9 commit 134c582
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 16 deletions.
15 changes: 0 additions & 15 deletions base/Notes.md

This file was deleted.

16 changes: 15 additions & 1 deletion base/README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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
Expand Down
62 changes: 62 additions & 0 deletions base/development_with_hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 134c582

Please sign in to comment.