monokrohm / fund-me-solidity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quickstart

git clone https://github.com/monokrohm/fund-me-solidity.git
cd fund-me-solidity
forge build

Foundry Usage

Build

$ forge build

Test

$ forge test


Simulate Sepolia chain using anvil

$ forge test --fork-url $SEPOLIA_URL

$ forge test --mt <function> -vvvvv --fork-url <rpc_url>

Coverage

See how much of the contract is being tested

$ forge coverage --fork-url/--rpc-url <rpc_url>

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Chisel

Solidity in terminal

$ chisel

Anvil

$ anvil

Deploy

$ forge script script/DeployFundMe.s.sol --rpc-url <rpc_url> --private-key <your_private_key> --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY

Scripts

Run scripts after deploying to a testnet or local net

$ cast send <FUNDME_CONTRACT_ADDRESS> "fund()" --value 0.1ether --private-key <PRIVATE_KEY>


Run a specific contract in a script

$ forge script script/Interactions.s.sol:FundFundMe --rpc-url <rpc_url>  --private-key <your_private_key>  --broadcast

Help

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

About


Languages

Language:Solidity 88.7%Language:Makefile 11.3%