Skip to main content

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

NameTypeDescription
intentstruct IOrionEncryptedVault.EncryptedIntent[]EncryptedIntent struct containing the tokens and encrypted weights.
inputProofbytescontains 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

NameTypeDescription
tokensaddress[]The tokens in the portfolio.
sharesPerAsseteuint128[]The shares per asset in the portfolio.

getIntent

function getIntent() external view returns (address[] tokens, euint128[] weights)

Get the encrypted intent.

Return Values

NameTypeDescription
tokensaddress[]The tokens in the intent.
weightseuint128[]The weights in the intent.

isIntentValid

function isIntentValid() external view returns (bool)

Get the intent validity.

Return Values

NameTypeDescription
[0]boolisIntentValid 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

NameTypeDescription
portfoliostruct IOrionEncryptedVault.EncryptedPortfolio[]Array of EncryptedPortfolio structs It contains the new portfolio token addresses and encrypted number of shares per asset.
newTotalAssetsuint256The 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

NameTypeDescription
requestIDuint256The request ID
cleartextsbytesThe cleartexts
decryptionProofbytesThe decryption proof