Skip to content

Latest commit

 

History

History
94 lines (72 loc) · 2.56 KB

README.md

File metadata and controls

94 lines (72 loc) · 2.56 KB

Web3-hackaton-1

Getting started with Solidity and Foundry. We will complete a TodoList smart contract, deploy it to the Base blockchain on the Sepolia testnet and interact with the smart contract through base scan.

⚙️ Prerequisites

Before we start there are a few things you need to do.

✨Notes (for Base Sepolia Testnet)

Setting up deployer

🚨 You will need the private key from your coinbase wallet (NEVER show this to anyone EVER!). 🔐 When you have your private key run the command below to store your private key in an encrypted state on your local machine.

cast wallet import deployer --interactive

To get your private key go to your CoinBase Wallet > Settings > Show Private Key. Paste it to the terminal after running the command and then set a password.

Deploy:

You have to run source .env to read the .env values. Then you can deploy by running:

forge create ./src/TodoList.sol:TodoList --rpc-url $BASE_SEPOLIA_RPC --account deployer --verify --etherscan-api-key $BASESCAN_API_KEY

To checkout your deployed contract go to: https://sepolia.basescan.org/address and search for the contracts address that you got from the terminal when you ran forge create.

Verify deployed contract:

forge verify-contract 0x8ab1ed35bf801f4e4a326076dbed122b40747fc9 ./src/CoinFlip.sol:CoinFlip --etherscan-api-key $BASESCAN_API_KEY --chain-id 84532 --watch

Install dependencies

# Install Solmate and OpenZeppelin contracts as dependencies
forge install transmissions11/solmate Openzeppelin/[email protected]

Usage

Build

forge build

Test

forge test

Debug

forge test --debug testCreateTask

Format

forge fmt

Gas Snapshots

forge snapshot

Anvil

anvil

Cast

cast <subcommand>

Help

forge --help
anvil --help
cast --help