HomeSmart Contracts
Polygon Mainnet — Chain ID 137

Smart Contracts

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

Contract Architecture

User
CCTPBridgeRouter
YieldVault (ERC4626)
AaveV3Adapter (slot 0)
pad
pad
pad
pad
YieldVault
MorphoAdapter (slot 1)
Chainlink Functions
AIOptimizer
YieldVault.rebalance()

YieldVault

contracts/YieldVault.sol
0x5Ac3257f05FE0B1087B8Ac915DA79D6FA9B37b04

Core vault contract. Users deposit native USDC and receive bfUSDC shares representing their proportional ownership. Implements OpenZeppelin ERC4626 with 9 additional security features. Supports up to 20 protocol adapter slots — currently Aave V3 (slot 0) and Morpho (slot 1) are active.

Features & Security

ERC4626-compliant share accounting
Share inflation attack protection (virtual shares offset)
Reentrancy protection on all state-changing functions
Protocol-aware deposit/withdrawal limits (5% liquidity buffer)
Harvest griefing prevention (minimum yield threshold)
Rebalance slippage protection (1% max)
Circuit breaker for emergency withdrawals
Performance fee collection (5%, configurable)
24-hour adapter activation timelock
Up to 20 protocol adapter slots (setProtocolName for new slots)

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(address indexed oldProtocol, address indexed newProtocol, uint256 amount, uint256 timestamp)

Protocol rebalance completed

PerformanceFeeCollected(uint256 feeInUSDC, uint256 timestamp)

Yield harvest and fee collection

ProtocolAdapterUpdated(uint8 indexed protocolId, address adapter)

New adapter registered at a slot

ProtocolNameUpdated(uint8 indexed protocolId, string name)

Display name set for a protocol slot

Dependencies

OpenZeppelin ERC4626OpenZeppelin ReentrancyGuardIProtocolAdapterAIOptimizer

External Protocol Addresses

USDC (Native)
Aave V3 Pool
Aave aPolUSDCn
Morpho Steakhouse USDC
CCTP MessageTransmitter
CCTP TokenMessenger
Chainlink Functions Router
LINK Token

Always verify contract addresses on Polygonscan before interacting. Active protocol slots: Aave V3 (slot 0) and Morpho — Steakhouse High Yield USDC (slot 1). Spark (slot 2) and Compound V3 (slot 3) are reserved but not deployed.