🟒mint_with_identity_depository

Permissionless - Callable for collateral amount input larger than 0 and below global cap and depository cap when minting is enabled

Flow

  • Checks

    • Anchor IDL accounts checks

    • Validates: non-zero collateral_amount

    • Validates: user collateral is not less than the collateral_amount input

    • Validates: mint_disabled is false for the depository

  • Handler

    • Transfer collateral_amount of from user collateral's ATA to collateral_vault

    • Mints the redeemable_amount (same as collateral_amount) of redeemable mint to the user

    • Updates the accounting in both depository and controller

    • Checks for any overflow on the redeemable_circulating_supply and redeemable_amount_under_management_cap

    • Emits Anchor MintWithIdentityDepositoryEvent event

Parameters

collateral_amount - the amount of collateral to be processed through minting

Accounts in

Last updated

Was this helpful?