This is a starter kit for interacting with Flare blockchain using Foundry. It provides example code for interacting with the enshrined Flare protocols (FTSO, FDC, FAssets), and useful deployed contracts. It also demonstrates how the official Flare smart contract periphery package can be used in your projects.
- Foundry installed
Install all dependencies:
forge soldeer installCopy the .env.example to .env and fill in your private key:
cp .env.example .envAt minimum, set PRIVATE_KEY to a funded wallet on the target network. The .env.example file contains all available configuration options including RPC URLs, API keys, verifier URLs, and DA Layer endpoints.
Load environment variables and run any script with Foundry:
source .env && forge script script/HelloWorld.s.sol --rpc-url coston2 --broadcastforge testscript/
├── fdcExample/ # Flare Data Connector (all attestation types)
├── ftso/ # FTSO price feed examples
├── customFeeds/ # Custom FDC-backed price feeds
├── fassets/ # FAssets minting, bridging, redemption
├── adapters/ # Third-party oracle adapters (Chainlink, Pyth, etc.)
├── boringVault/ # BoringVault DeFi integration
├── firelight/ # Firelight protocol interactions
├── wnat/ # Wrapped native token operations
├── HelloWorld.s.sol # Simple starter example
└── GuessingGame.s.sol # Interactive game example
src/ # Smart contract source files
test/ # Forge tests