CoreIntegrate with CreatorOVault
How to integrate with CreatorOVault
CreatorOVault is ERC-4626 + protocol extensions. Do not treat it as a vanilla Yearn/OZ vault. Full deviation table: ERC-4626 deviations. Impairment: state machine.
Retail users should go through CreatorOVaultWrapper (creator coin ↔ ShareOFT). This page is for routers, keepers, and vault-share () holders.
Tokens
| Token | Symbol | What it is |
|---|---|---|
| Creator coin | e.g. AKITA | Vault asset() |
| Vault shares | ERC-4626 share. 1000 virtual-share offset. | |
| ShareOFT | 1000:1 wrap of . Trading / lottery / LZ mesh. |
after wrap. Do not display to end users.
Deposit / mint
deposit/mintare gated: whitelist (if enabled), not paused, not shutdown, vaultNormal(notSuspect).- First deposit has a minimum (
FirstDepositTooSmall). previewDeposit/previewMintare vanilla OZ. They ignore deposit limit, whitelist, and strategy marks. UsemaxDeposit/maxMint(ViewLib) as the capacity check; do not size a tx from preview alone.- Agent-lane vaults:
maxMint == 0,previewMintreverts. Usedeposit.
Withdraw / redeem
Three-arg ERC-4626 paths stay. Large exits are not instant.
| Size | Path |
|---|---|
Below largeWithdrawalThreshold | redeem / withdraw (optional 4-arg maxLoss bps) |
| At or above threshold | queueWithdrawal(shares, receiver) → wait unlockBlock → claimQueuedWithdrawal() |
LargeWithdrawalMustBeQueuedif you try the sync path on a large size.- One queue slot per address.
cancelQueuedWithdrawalreturns shares. - Same-block deposit→exit is blocked (
withdrawDelayBlocks, default 1). Trusted adapters skip the stamp. - 4-arg
redeem/withdraw(..., maxLoss)is Yearn-style. 3-arg usesdefaultMaxLossBps(0 = allow all).
Previews (integrator trap)
| Function | Honest when queues / strategies are live? |
|---|---|
previewRedeem | Yes — caps at liquid − queued |
erc4626PreviewRedeem | No — raw OZ convert |
previewWithdraw / previewDeposit / previewMint | No — inherited OZ |
maxWithdraw / maxRedeem | Yes — liquidity + sync-size ceiling |
withdrawalEta(user, shares) | Yes — cooldown + queue delay |
positionOf(user) | Yes — holdings, queue, claimable |
Prefer previewRedeem + maxRedeem + withdrawalEta. Do not quote large exits with previewWithdraw.
CreatorOVaultWrapper.withdraw refuses the queue path (AsyncRedemptionRequired). Large exits must unwrap to and call queueWithdrawal on the vault.
maxLoss
maxLoss is bps of requested assets, not of the shortfall. Unrealised strategy loss above the cap reverts StrategyHasUnrealisedLosses. If you do not pass it, you inherit defaultMaxLossBps.
Impairment
While vaultMode == Suspect:
deposit/mint/withdraw/redeemrevertmaxDeposit/maxMint/maxWithdraw/maxRedeemreturn 0
Do not retry sync exits. Recovery is merkle claims + escrow (mintImpairmentClaim / claimImpairmentRecovery). Preferred leaves are ShareOFT holders, not vault.balanceOf(wrapper). Details: Impairment v1 disclosures.
Operators
Unregistered addresses are permissionless. A grant — including setOperatorPerms(exec, 0) — fail-closes that exec. clearOperatorPerms restores baseline. Activation batcher checks isAuthorizedOperator(exec, OP_ACTIVATE).
What not to add
The vault file is an ABI + storage facade. New product logic goes in a module or OVaultViewLib, not on CreatorOVault.