🔐edit_mercurial_vault_depository

Permissionned - Update one or multiple properties of the mercurial vault depository in a single call

Flow

  • Checks

    • Anchor IDL accounts checks

  • Handler

    • Update the depository PDA internal data with the new value

    • Emits Anchor SetDepositoryRedeemableAmountUnderManagementCapEvent or/and SetDepositoryMintingFeeInBpsEvent or/and SetDepositoryRedeemingFeeInBpsEvent or/and SetDepositoryMintingDisabledEvent event

Parameters

EditMercurialVaultDepositoryFields - a specific object type that accomodate all the new values for updating the properties in depository. The latest structure:

{
    redeemable_amount_under_management_cap: Option<u128>,
    minting_fee_in_bps: Option<u8>,
    redeeming_fee_in_bps: Option<u8>,
    minting_disabled: Option<bool>,
}

Accounts in

programs/uxd/src/instructions/edit_identity_depository.rs
// ...

#[derive(Accounts)]
pub struct EditMercurialVaultDepository<'info> {
    /// #1 Authored call accessible only to the signer matching Controller.authority
    pub authority: Signer<'info>,

    /// #2 The top level UXDProgram on chain account managing the redeemable mint
    #[account(
        mut,
        seeds = [CONTROLLER_NAMESPACE],
        bump = controller.load()?.bump,
        has_one = authority @UxdError::InvalidAuthority,
        constraint = controller.load()?.registered_mercurial_vault_depositories.contains(&depository.key()) @UxdError::InvalidDepository
    )]
    pub controller: AccountLoader<'info, Controller>,

    /// #3 UXDProgram on chain account bound to a Controller instance.
    /// The `MercurialVaultDepository` manages a MercurialVaultAccount for a single Collateral.
    #[account(
        mut,
        seeds = [MERCURIAL_VAULT_DEPOSITORY_NAMESPACE, depository.load()?.mercurial_vault.as_ref(), depository.load()?.collateral_mint.as_ref()],
        bump = depository.load()?.bump,
        has_one = controller @UxdError::InvalidController,
    )]
    pub depository: AccountLoader<'info, MercurialVaultDepository>,
}

// ...

Last updated

Was this helpful?