Skip to content

vocdoni/degen-communities

Repository files navigation

DISCLAIMER: THIS IS A POC UNDER DEVELOPMENT, DO NOT USE IT IN PRODUCTION ENVIRONMENTS

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ source .env
  • Base sepolia
forge script --chain-id 84532 script/Deploy.s.sol:CommunityHubDeployScript --rpc-url ${BASE_SEPOLIA_RPC_URL} --broadcast --slow --verify --verifier-url ${BASESCAN_SEPOLIA_URL} --etherscan-api-key ${BASESCAN_SEPOLIA_API_KEY} --optimize --optimizer-runs 20000 -- --vvvv
  • Base
forge script --chain-id 8453 script/Deploy.s.sol:CommunityHubDeployScript --rpc-url ${BASE_RPC_URL} --broadcast --slow --verify --verifier-url ${BASESCAN_URL} --etherscan-api-key ${BASESCAN_API_KEY} --optimize --optimizer-runs 20000 -- --vvvv

For production deployments do not use a public RPC. Use a dedicated one or things like the node mempool can cause the script to fail.

Deploying locally using anvil

$ anvil
  • Update your .env file with a private key given to you by Anvil.
forge script script/Deploy.s.sol:MyScript --fork-url http://localhost:8545 --broadcast

Verify

forge verify-contract --chain-id 8453 --num-of-optimizations 20000 --watch --verifier-url ${BASESCAN_URL} --etherscan-api-key ${BASESCAN_API_KEY} --compiler-version v0.8.25+commit.b61c2a9 src/.sol:

Cast

$ cast <subcommand>

Help

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

Hardhat migration script

npx hardhat --network base run ./script/migratev2.ts

About

Smart contracts for Degen Communities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published