HomeSmart Contracts
Polygon Mainnet — Chain ID 137

Smart Contracts

BridgeFlow's on-chain architecture: 6 contracts, 9 security features, verified on Polygonscan.

Contract Architecture

User
CCTPBridgeRouter
YieldVault (ERC4626)
AaveV3Adapter
pad
pad
pad
pad
YieldVault
CompoundV3Adapter
pad
pad
pad
pad
YieldVault
SparkAdapter
Chainlink Functions
AIOptimizer
YieldVault.rebalance()

YieldVault

contracts/YieldVault.sol
0x5Eb88A93672cA50afF8b02fdB459610cb3b4713A

Core vault contract. Users deposit USDC and receive BF-USDC shares representing their proportional ownership. Implements OpenZeppelin ERC4626 with 9 additional security features.

Features & Security

ERC4626-compliant share accounting
Share inflation attack protection (dead shares + initial deposit)
Reentrancy protection on all state-changing functions
Protocol-aware deposit/withdrawal limits
Harvest griefing prevention (dust threshold)
Rebalance slippage protection
Circuit breaker for emergency withdrawals
Performance fee collection (configurable, default 5%)
24-hour adapter activation timelock

Events

Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares)

Emitted on deposit

Withdraw(address indexed caller, address indexed receiver, address indexed owner, uint256 assets, uint256 shares)

Emitted on withdrawal

Rebalanced(uint8 fromProtocol, uint8 toProtocol, uint256 amount)

Protocol rebalance completed

HarvestCompleted(uint256 yield, uint256 fee)

Yield harvest + fee collection

Dependencies

OpenZeppelin ERC4626OpenZeppelin ReentrancyGuardIProtocolAdapterIAIOptimizer

External Protocol Addresses

USDC (Native)
Aave V3 Pool
Aave aPolUSDCn
Compound V3 Comet
Spark Pool (Polygon)
Spark spUSDC
CCTP MessageTransmitter
CCTP TokenMessenger
Chainlink Functions Router
LINK Token

BridgeFlow contract addresses will be finalized after mainnet deployment. Verify all addresses on Polygonscan before interacting. Never interact with unverified contracts.