Integration guidesERC-4626 deviations
ERC-4626 deviations
Where CreatorOVault intentionally differs from a vanilla ERC-4626 vault, why, and what integrators should do about it.
CreatorOVault inherits OpenZeppelin's ERC4626 and exposes a familiar ERC-4626 interface, but it is not a pure drop-in. Treat it as ERC-4626 plus protocol extensions.
Deviations
| Deviation | Why | What integrators should do |
|---|---|---|
Large withdrawals are queued. Exits at or above largeWithdrawalThreshold revert LargeWithdrawalMustBeQueued on the sync path and must use queueWithdrawal, wait, then claimQueuedWithdrawal. | MEV and flash-loan protection, and time to unwind strategies | Don't assume instant liquidity for large positions. Check maxRedeem and withdrawalEta before quoting. |
Previews are not symmetric. previewRedeem subtracts queued shares. previewDeposit / previewMint / previewWithdraw stay vanilla OpenZeppelin and can be wrong when queues or strategies are active. | Honest redeem quotes without rewriting every inherited preview | Prefer previewRedeem. Size deposits from maxDeposit / maxMint, not previews. |
Four-argument redeem / withdraw. Besides the standard three-argument versions, the vault exposes overloads with a Yearn-style maxLoss in bps. | Let callers cap realized strategy loss | Pass maxLoss when you need a bound. The three-argument versions use defaultMaxLossBps. |
Deposits are gated. deposit / mint check the whitelist (if enabled), pause, shutdown, and impairment mode. Exit paths have different guards. | Operator control during launch and incidents | Read maxDeposit / maxMint first; a zero means the call will revert. |
totalAssets is not just the idle balance. It includes strategy marks with an idle clamp via OVaultViewLib, not asset.balanceOf(address(this)). | Assets are deployed to strategies | Use totalAssets() and pricePerShare(); don't read the vault's token balance. |
Fixed virtual shares. _decimalsOffset() = 3 (1000 virtual shares). | Inflation-attack protection | Expect about 1000 per creator coin at bootstrap. The wrapper then converts 1000 to 1 ShareOFT (). |
First deposit. Activation accepts exactly 100,000,000 creator coins. The vault reverts FirstDepositTooSmall below 100,000,000. | Inflation-attack protection and launch sizing | Only relevant at activation. See Activate vault. |
Suspect mode. While an impairment is tripped, deposits and sync exits revert and all max* functions return 0. | Freeze accounting while a strategy loss is assessed | Don't retry. Follow the impairment state machine. |
Design stance
The vault contract is an ABI and storage facade; core logic lives in modules. New product features should not be added as new methods on CreatorOVault.
For the full walkthrough of queues, previews, and maxLoss, see Integrate with CreatorOVault. For ERC-165 and ERC-7575 details, see Vault capabilities.