Skip to content

Toy project I made to learn Blockchain development with Solidity + foundry-rs framework

Notifications You must be signed in to change notification settings

mohamed-said/foundry-fund-me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundry Fund Me

Allows people to send me money. And... yeah!

A toy project to practice solidity and blockchain development using Foundry framework.

Foundry is a super nice and easy tool built in Rust.

Foundry Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build

Some dependencies might be needed first. To install run the following in the project directory:

$ forge install smartcontractkit/chainlink-brownie-contracts@0.8.0 --no-commit
$ forge install Cyfrin/foundry-devops --no-commit

Test

Run all the test cases.

$ forge test

To run a specific test:

$ forge test --mt <test_case_name>

To add extra visibility and debug output, you can -v | -vv | -vvv

$ forge test --mt <test_case_name> -vvv

Format

$ forge fmt

Gas Snapshots

This command creates a snapshot for the amount of gas used by your functions and test cases as well.

$ forge snapshot

Anvil

Use this tool to fire up you local chain for testing and experimentation.

$ anvil

Deploy

$ forge script script/DeployFundMe.s.sol:DeployFundMe --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY) --broadcast --verify --etherscan-api-key $(ETHERSCAN_API_KEY) -vvv

You can also use the included Makefile to do deploy. Make sure you include your RPC URLs and the neccessary keys in your .env file.

Example:

$ make deploy-sepolia

About

Toy project I made to learn Blockchain development with Solidity + foundry-rs framework

Resources

Stars

Watchers

Forks