diff --git a/clients/js/vault_client/errors/jitoVault.ts b/clients/js/vault_client/errors/jitoVault.ts index 0e9eb912..64ce4663 100644 --- a/clients/js/vault_client/errors/jitoVault.ts +++ b/clients/js/vault_client/errors/jitoVault.ts @@ -124,6 +124,8 @@ export const JITO_VAULT_ERROR__INVALID_DEPOSIT_TOKEN_ACCOUNT = 0x41c; // 1052 export const JITO_VAULT_ERROR__NO_SUPPORTED_MINT_BALANCE_CHANGE = 0x41d; // 1053 /** InvalidEpochLength: InvalidEpochLength */ export const JITO_VAULT_ERROR__INVALID_EPOCH_LENGTH = 0x41e; // 1054 +/** NoZeroReturnMintTo: NoZeroReturnMintTo */ +export const JITO_VAULT_ERROR__NO_ZERO_RETURN_MINT_TO = 0x41f; // 1055 /** ArithmeticOverflow: ArithmeticOverflow */ export const JITO_VAULT_ERROR__ARITHMETIC_OVERFLOW = 0xbb8; // 3000 /** ArithmeticUnderflow: ArithmeticUnderflow */ @@ -143,6 +145,7 @@ export type JitoVaultError = | typeof JITO_VAULT_ERROR__NCN_VAULT_SLASHER_TICKET_UNSLASHABLE | typeof JITO_VAULT_ERROR__NCN_VAULT_TICKET_UNSLASHABLE | typeof JITO_VAULT_ERROR__NO_SUPPORTED_MINT_BALANCE_CHANGE + | typeof JITO_VAULT_ERROR__NO_ZERO_RETURN_MINT_TO | typeof JITO_VAULT_ERROR__OPERATOR_OVERFLOW | typeof JITO_VAULT_ERROR__OPERATOR_VAULT_TICKET_UNSLASHABLE | typeof JITO_VAULT_ERROR__SLASHER_OVERFLOW @@ -205,6 +208,7 @@ if (process.env.NODE_ENV !== 'production') { [JITO_VAULT_ERROR__NCN_VAULT_SLASHER_TICKET_UNSLASHABLE]: `NcnVaultSlasherTicketUnslashable`, [JITO_VAULT_ERROR__NCN_VAULT_TICKET_UNSLASHABLE]: `NcnVaultTicketUnslashable`, [JITO_VAULT_ERROR__NO_SUPPORTED_MINT_BALANCE_CHANGE]: `NoSupportedMintBalanceChange`, + [JITO_VAULT_ERROR__NO_ZERO_RETURN_MINT_TO]: `NoZeroReturnMintTo`, [JITO_VAULT_ERROR__OPERATOR_OVERFLOW]: `OperatorOverflow`, [JITO_VAULT_ERROR__OPERATOR_VAULT_TICKET_UNSLASHABLE]: `OperatorVaultTicketUnslashable`, [JITO_VAULT_ERROR__SLASHER_OVERFLOW]: `SlasherOverflow`, diff --git a/clients/rust/vault_client/src/generated/errors/jito_vault.rs b/clients/rust/vault_client/src/generated/errors/jito_vault.rs index 481bb10d..17bc305b 100644 --- a/clients/rust/vault_client/src/generated/errors/jito_vault.rs +++ b/clients/rust/vault_client/src/generated/errors/jito_vault.rs @@ -174,6 +174,9 @@ pub enum JitoVaultError { /// 1054 - InvalidEpochLength #[error("InvalidEpochLength")] InvalidEpochLength = 0x41E, + /// 1055 - NoZeroReturnMintTo + #[error("NoZeroReturnMintTo")] + NoZeroReturnMintTo = 0x41F, /// 3000 - ArithmeticOverflow #[error("ArithmeticOverflow")] ArithmeticOverflow = 0xBB8, diff --git a/idl/jito_vault.json b/idl/jito_vault.json index 8b2b9246..7719682b 100644 --- a/idl/jito_vault.json +++ b/idl/jito_vault.json @@ -2361,6 +2361,11 @@ "name": "InvalidEpochLength", "msg": "InvalidEpochLength" }, + { + "code": 1055, + "name": "NoZeroReturnMintTo", + "msg": "NoZeroReturnMintTo" + }, { "code": 3000, "name": "ArithmeticOverflow", diff --git a/vault_program/src/mint_to.rs b/vault_program/src/mint_to.rs index d4f148f2..01062988 100644 --- a/vault_program/src/mint_to.rs +++ b/vault_program/src/mint_to.rs @@ -92,6 +92,11 @@ pub fn process_mint( vrt_to_fee_wallet, } = vault.mint_with_fee(amount_in, min_amount_out)?; + if vrt_to_depositor == 0 { + msg!("Depositor will not receive any VRT"); + return Err(VaultError::NoZeroReturnMintTo.into()); + } + // transfer tokens from depositor to vault { invoke( diff --git a/vault_sdk/src/error.rs b/vault_sdk/src/error.rs index 3212f5d6..1b0431a7 100644 --- a/vault_sdk/src/error.rs +++ b/vault_sdk/src/error.rs @@ -113,6 +113,8 @@ pub enum VaultError { NoSupportedMintBalanceChange, #[error("InvalidEpochLength")] InvalidEpochLength, + #[error("NoZeroReturnMintTo")] + NoZeroReturnMintTo, #[error("ArithmeticOverflow")] ArithmeticOverflow = 3000,