Smart Contracts
BridgeFlow's on-chain architecture: 5 contracts, 9 security features, verified on Polygonscan.
Contract Architecture
YieldVault
contracts/YieldVault.sol0x5Ac3257f05FE0B1087B8Ac915DA79D6FA9B37b04Core 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
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
External Protocol Addresses
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.