Solidity API
OrionEncryptedVault
A privacy-preserving implementation of OrionVault where curator intents are submitted in encrypted form
_portfolio
mapping(address => euint128) _portfolio
Current portfolio shares per asset (w_0) - mapping of token address to live allocation
_portfolioKeys
address[] _portfolioKeys
_intent
mapping(address => euint128) _intent
Curator intent (w_1) - mapping of token address to target allocation
_intentKeys
address[] _intentKeys
_seenTokens
mapping(address => bool) _seenTokens
Temporary mapping to track seen tokens during submitIntent to check for duplicates
_ezero
euint128 _ezero
_eTrue
ebool _eTrue
_encryptedTotalWeight
euint128 _encryptedTotalWeight
isIntentValid
bool isIntentValid
Whether the intent is valid
constructor
constructor(address vaultOwner, address curator, contract IOrionConfig configAddress, string name, string symbol, uint8 feeType, uint16 performanceFee, uint16 managementFee) public
Constructor
Parameters
Name | Type | Description |
---|---|---|
vaultOwner | address | The address of the vault owner |
curator | address | The address of the vault curator |
configAddress | contract IOrionConfig | The address of the OrionConfig contract |
name | string | The name of the vault |
symbol | string | The symbol of the vault |
feeType | uint8 | The fee type |
performanceFee | uint16 | The performance fee |
managementFee | uint16 | The management fee |
submitIntent
function submitIntent(struct IOrionEncryptedVault.EncryptedIntent[] intent, bytes inputProof) external
Submit an encrypted portfolio intent.
The weights are interpreted as percentage of total supply.
Parameters
Name | Type | Description |
---|---|---|
intent | struct IOrionEncryptedVault.EncryptedIntent[] | EncryptedIntent struct containing the tokens and encrypted weights. |
inputProof | bytes | contains the ZKPoK to validate the authenticity of the encrypted inputs. https://docs.zama.ai/protocol/solidity-guides/smart-contract/inputs#validating-encrypted-inputs |
_validateIntent
function _validateIntent(address[] assets, euint128 totalWeight) internal
Validates the intent
Parameters
Name | Type | Description |
---|---|---|
assets | address[] | The assets in the intent |
totalWeight | euint128 | The total weight of the intent |
getPortfolio
function getPortfolio() external view returns (address[] tokens, euint128[] sharesPerAsset)
Returns the current encrypted portfolio (w_0)
Return Values
Name | Type | Description |
---|---|---|
tokens | address[] | The tokens in the portfolio. |
sharesPerAsset | euint128[] | The shares per asset in the portfolio. |
getIntent
function getIntent() external view returns (address[] tokens, euint128[] weights)
Get the encrypted intent.
Return Values
Name | Type | Description |
---|---|---|
tokens | address[] | The tokens in the intent. |
weights | euint128[] | The weights in the intent. |
updateVaultState
function updateVaultState(struct IOrionEncryptedVault.EncryptedPortfolio[] portfolio, uint256 newTotalAssets) external
Updates the vault's portfolio state and total assets
Can only be called by the liquidity orchestrator. Clears the previous portfolio and replaces it with the new one.
Parameters
Name | Type | Description |
---|---|---|
portfolio | struct IOrionEncryptedVault.EncryptedPortfolio[] | Array of EncryptedPortfolio structs It contains the new portfolio token addresses and encrypted number of shares per asset. |
newTotalAssets | uint256 | The new total assets value for the vault |
callbackDecryptSingleEbool
function callbackDecryptSingleEbool(uint256 requestID, bytes cleartexts, bytes decryptionProof) external
Callback function to decrypt a single ebool
Parameters
Name | Type | Description |
---|---|---|
requestID | uint256 | The request ID |
cleartexts | bytes | The cleartexts |
decryptionProof | bytes | The decryption proof |