A template repository for Foundry/Solidity projects with CI, static analysis, and auto-generated docs.
Prerequisites: Install Foundry
# Clone and set up
git clone https://github.com/owieth/foundry-setup
cd foundry-setup
forge install
# Copy environment variables
cp .env.example .env
# Fill in your values, then:
source .envforge build
forge test -vvvv
forge snapshotforge fmt
forge fmt --checkforge doc
forge doc --serve # preview at http://localhost:3000source .env
forge script script/<Script>.s.sol:<Contract> --rpc-url <chain> --broadcast --verify -vvvvv# Fresh local chain
anvil
# Fork Sepolia
anvil -f https://eth-sepolia.g.alchemy.com/v2/<your_api_key>Layout of **.sol:
- version
- imports
- interfaces, libraries, contracts
- usings (
using ... for ...) - errors
- type declarations
- state variables
- events
- modifiers
- functions
Layout of functions (inside **.sol after modifiers):
- constructor
- receive (if exists)
- fallback (if exists)
- external
- public
- internal
- private
- view & pure (last per visibility group)
More → STYLE.md