KingsVault
Contract:
KingsVaultV2AsyncRedeem.solInherits: ERC-4626, ERC-7540 (async redeem), AccessControl, Pausable
Overview
KingsVault is the user-facing entry point deployed on Ethereum Mainnet. It accepts USDC deposits (synchronous, ERC-4626) and processes withdrawals via an asynchronous redeem lifecycle (ERC-7540). It also receives cross-chain settlement data from HyperEVM via CCIP.
Roles
| Role | Permissions |
|---|---|
ROLE_INVESTOR |
deposit(), redeem(), emergencyRedeem() |
ROLE_ACCOUNTANT |
settle() |
ROLE_OWNER |
pause(), unpause(), setFeeBP(), confirmSettlement(), closeDown(), windingUp() |
Read Functions
| Function | Signature | Returns | Description |
|---|---|---|---|
asset |
asset() → address |
USDC address | The underlying ERC-20 token |
totalAssets |
totalAssets() → uint256 |
Total USDC value | Vault idle + portfolio + cross-chain |
totalSupply |
totalSupply() → uint256 |
Total shares | Standard ERC-20 supply |
balanceOf |
balanceOf(address) → uint256 |
Share balance | Standard ERC-20 balance |
maxRedeem |
maxRedeem(address owner) → uint256 |
Available shares | balanceOf - sum(all request shares) |
pendingRedeemRequest |
pendingRedeemRequest(address) → uint256 |
Pending shares | Requests not yet executed |
claimableRedeemRequest |
claimableRedeemRequest(address) → uint256 |
Claimable shares | Executed requests ready to claim |
previewClaimableRedeem |
previewClaimableRedeem(uint256, address) → uint256 |
Estimated USDC | FIFO calculation of claimable assets |
previewDeposit |
previewDeposit(uint256 assets) → uint256 |
Estimated shares | Based on current marked price |
isShutdown |
isShutdown() → bool |
Shutdown state | True if closeDown() was called |
controller |
controller() → address |
Controller address | IEpochPrice implementation |
Write Functions
| Function | Signature | Role | Description |
|---|---|---|---|
deposit |
deposit(uint256 assets, address receiver) → uint256 |
ROLE_INVESTOR |
Synchronous ERC-4626 deposit |
requestRedeem |
requestRedeem(uint256 shares, address owner) → uint256 |
Any (see note) | Submit async redeem request |
redeem |
redeem(uint256 shares, address receiver, address owner) → uint256 |
ROLE_INVESTOR |
Claim executed requests (FIFO) |
withdraw |
withdraw(uint256, address, address) |
— | Always reverts with OnlyRedeemSupported() |
emergencyRedeem |
emergencyRedeem() |
ROLE_INVESTOR |
Pro-rata exit during shutdown only |
settle |
settle() |
ROLE_ACCOUNTANT |
Recalculate NAV, update PPS, mint fee shares |
confirmSettlement |
confirmSettlement() |
ROLE_OWNER |
Confirm proposed PPS (Stage 1 dual confirmation) |
setFeeBP |
setFeeBP(uint256) |
ROLE_OWNER |
Set performance fee in basis points |
pause |
pause() |
ROLE_OWNER |
Halt all operations |
unpause |
unpause() |
ROLE_OWNER |
Resume operations |
closeDown |
closeDown() |
ROLE_OWNER |
Set isShutdown = true, block deposits |
windingUp |
windingUp() |
ROLE_OWNER |
Final settlement, enable emergency redeem |
requestRedeem Access
The current implementation has no explicit access-control modifier on requestRedeem. Frontend should verify user eligibility before calling.
Events
| Event | Parameters |
|---|---|
Deposit |
sender (indexed), owner (indexed), assets, shares |
Withdraw |
sender (indexed), receiver (indexed), owner (indexed), assets, shares |
WithdrawQueued |
owner (indexed), shares |
Errors
| Error | Trigger |
|---|---|
OnlyRedeemSupported() |
withdraw() called (disabled) |
InsufficientQueuedShares(requested, available) |
Redeem exceeds claimable |
VaultNotShutdown() |
emergencyRedeem() called while active |
NoSharesToRedeem() |
Zero share balance on emergency redeem |
Pricing Model
KingsVaultV2AsyncRedeem overrides the base pricing to use marked price only (no spot/marked dual pricing from V2 base):
_effectivePrice()always returns the Controller'spreviewMarkedPrice(vault).- Shares are calculated as
assets / markedPrice(rounded down, favoring protocol).
CCIP Integration
KingsVault acts as both CCIP Sender and CCIP Receiver on Ethereum:
| Direction | Message Type | Action |
|---|---|---|
| ETH → HEVM | Deposit instruction | Sends USDC + abi.encode("PUSH_TO_CORE", ...) |
| ETH → HEVM | Withdraw instruction | Sends request to retrieve funds from HLP |
| HEVM → ETH | Settlement data | Receives totalAsset value, updates PPS |
| HEVM → ETH | Withdrawal funds | Receives USDC, marks request as Claimable |