Solidity API
IOrionEncryptedVault
Interface for the Orion encrypted vault
EncryptedIntent
struct EncryptedIntent {
address token;
externalEuint128 weight;
}
EncryptedPortfolio
struct EncryptedPortfolio {
address token;
euint128 value;
}
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 |
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. |
isIntentValid
function isIntentValid() external view returns (bool)
Get the intent validity.
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | isIntentValid Whether the intent is valid. |
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 |