Skip to content

Users can fund a project with their USD. USD will be internally converted to ETH using chainlink-price-feeds.

Notifications You must be signed in to change notification settings

allwin199/fund-me-foundry

Repository files navigation

Foundry Fund Me

Quickstart

git clone https://github.com/worksofallwin/foundry-fund-me-v3.git
cd foundry-fund-me-v3
forge build

Usage

Anvil

  • Spin up the anvil chain
anvil
  • To load .env in terminal
source .env

Deploy:

This will default to your local node. You need to have it running in another terminal in order for it to deploy.

make deployToAnvil

Testing

forge test

or

  • Only run test functions matching the specified regex pattern.
forge test --mt testFunctionName

or

  • To fork Sepolia chain
forge test --fork-url $SEPOLIA_RPC_URL

Test Coverage

forge coverage

Deployment to a testnet or mainnet

  1. Setup environment variables
  • You'll want to set your SEPOLIA_RPC_URL in environment variables. You can add them to a .env file.

  • SEPOLIA_RPC_URL: This is url of the sepolia testnet node you're working with. You can get setup with one for free from Alchemy

  • Optionally, add your ETHERSCAN_API_KEY if you want to verify your contract on Etherscan.

  1. Use wallet options to Encrypt Private Keys
make deployToSepolia

Estimate gas

You can estimate how much gas things cost by running:

forge snapshot

And you'll see and output file called .gas-snapshot

Formatting

To run code formatting:

forge fmt

Thank you!

About

Users can fund a project with their USD. USD will be internally converted to ETH using chainlink-price-feeds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published