diff --git a/Anchor.toml b/Anchor.toml index 7b26010e5..d3ef91786 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -6,7 +6,7 @@ wallet = "~/.config/solana/id.json" uxd = "UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr" [programs.devnet] -uxd = "Hto7hH47haUP3Vrinym98BHkVdC3jtYWLXUhmfBSBT5N" +uxd = "4jv7rFE2DJ7HXDtJ812xLLnugXjPTU4iSpBUq8Dm6uEM" [registry] url = "https://anchor.projectserum.com" diff --git a/programs/uxd/src/instructions/initialize_controller.rs b/programs/uxd/src/instructions/initialize_controller.rs index 0f192a399..409ded540 100644 --- a/programs/uxd/src/instructions/initialize_controller.rs +++ b/programs/uxd/src/instructions/initialize_controller.rs @@ -1,4 +1,5 @@ use crate::declare_check_assert_macros; +use crate::error::check_assert; use crate::error::SourceFileId; use crate::Controller; use crate::UxdError; @@ -84,3 +85,18 @@ pub fn handler( }); Ok(()) } + +// Validate +impl<'info> InitializeController<'info> { + // Asserts that the redeemable mint decimals is between 0 and 9. + pub fn validate( + &self, + decimals: u8, + ) -> ProgramResult { + check!( + decimals <= SOLANA_MAX_MINT_DECIMALS, + UxdErrorCode::InvalidRedeemableMintDecimals + )?; + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/mango_dex/deposit_insurance_to_mango_depository.rs b/programs/uxd/src/instructions/mango_dex/deposit_insurance_to_mango_depository.rs index 0f7cccecf..2ffd31307 100644 --- a/programs/uxd/src/instructions/mango_dex/deposit_insurance_to_mango_depository.rs +++ b/programs/uxd/src/instructions/mango_dex/deposit_insurance_to_mango_depository.rs @@ -7,6 +7,9 @@ use anchor_spl::token::Transfer; use crate::AccountingEvent; use crate::Controller; use crate::UxdResult; +use crate::error::check_assert; +use crate::error::UxdErrorCode; +use crate::error::SourceFileId; use crate::error::UxdIdlErrorCode; use crate::CONTROLLER_NAMESPACE; use crate::MANGO_DEPOSITORY_NAMESPACE; @@ -16,6 +19,8 @@ use crate::MangoDepository; use crate::mango_program; use crate::events::DepositInsuranceToMangoDepositoryEvent; +declare_check_assert_macros!(SourceFileId::InstructionMangoDexDepositInsuranceToMangoDepository); + #[derive(Accounts)] pub struct DepositInsuranceToMangoDepository<'info> { pub authority: Signer<'info>, @@ -166,4 +171,19 @@ impl<'info> DepositInsuranceToMangoDepository<'info> { .update_insurance_amount_deposited(&AccountingEvent::Deposit, insurance_delta)?; Ok(()) } -} \ No newline at end of file +} + +// Validate +impl<'info> DepositInsuranceToMangoDepository<'info> { + pub fn validate( + &self, + insurance_amount: u64, + ) -> ProgramResult { + check!(insurance_amount > 0, UxdErrorCode::InvalidInsuranceAmount)?; + check!( + self.authority_insurance.amount >= insurance_amount, + UxdErrorCode::InsufficientAuthorityInsuranceAmount + )?; + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/mango_dex/mint_with_mango_depository.rs b/programs/uxd/src/instructions/mango_dex/mint_with_mango_depository.rs index 5a4cd62ff..c7b2c5093 100644 --- a/programs/uxd/src/instructions/mango_dex/mint_with_mango_depository.rs +++ b/programs/uxd/src/instructions/mango_dex/mint_with_mango_depository.rs @@ -17,6 +17,7 @@ use crate::MangoDepository; use crate::UxdError; use crate::UxdErrorCode; use crate::UxdResult; +use crate::SLIPPAGE_BASIS; use crate::COLLATERAL_PASSTHROUGH_NAMESPACE; use crate::CONTROLLER_NAMESPACE; use crate::MANGO_ACCOUNT_NAMESPACE; @@ -37,7 +38,7 @@ use mango::state::MangoAccount; use mango::state::PerpAccount; use mango::state::PerpMarket; -declare_check_assert_macros!(SourceFileId::InstructionMangoDexRedeemFromMangoDepository); +declare_check_assert_macros!(SourceFileId::InstructionMangoDexMintWithMangoDepository); #[derive(Accounts)] pub struct MintWithMangoDepository<'info> { @@ -429,3 +430,22 @@ impl<'info> MintWithMangoDepository<'info> { Ok(()) } } + +// Validate +impl<'info> MintWithMangoDepository<'info> { + pub fn validate( + &self, + collateral_amount: u64, + slippage: u32 + ) -> ProgramResult { + // Valid slippage check + check!(slippage <= SLIPPAGE_BASIS, UxdErrorCode::InvalidSlippage)?; + + check!(collateral_amount > 0, UxdErrorCode::InvalidCollateralAmount)?; + check!( + self.user_collateral.amount >= collateral_amount, + UxdErrorCode::InsufficientCollateralAmount + )?; + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/mango_dex/redeem_from_mango_depository.rs b/programs/uxd/src/instructions/mango_dex/redeem_from_mango_depository.rs index c0bde684b..34f408e90 100644 --- a/programs/uxd/src/instructions/mango_dex/redeem_from_mango_depository.rs +++ b/programs/uxd/src/instructions/mango_dex/redeem_from_mango_depository.rs @@ -17,6 +17,7 @@ use crate::Controller; use crate::MangoDepository; use crate::UxdError; use crate::UxdResult; +use crate::SLIPPAGE_BASIS; use crate::COLLATERAL_PASSTHROUGH_NAMESPACE; use crate::CONTROLLER_NAMESPACE; use crate::MANGO_ACCOUNT_NAMESPACE; @@ -404,3 +405,22 @@ impl<'info> RedeemFromMangoDepository<'info> { Ok(()) } } + +// Validate +impl<'info> RedeemFromMangoDepository<'info> { + pub fn validate( + &self, + redeemable_amount: u64, + slippage: u32, + ) -> ProgramResult { + // Valid slippage check + check!(slippage <= SLIPPAGE_BASIS, UxdErrorCode::InvalidSlippage)?; + + check!(redeemable_amount > 0, UxdErrorCode::InvalidRedeemableAmount)?; + check!( + self.user_redeemable.amount >= redeemable_amount, + UxdErrorCode::InsufficientRedeemableAmount + )?; + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/mango_dex/withdraw_insurance_from_mango_depository.rs b/programs/uxd/src/instructions/mango_dex/withdraw_insurance_from_mango_depository.rs index 4e64ea271..fea9e5848 100644 --- a/programs/uxd/src/instructions/mango_dex/withdraw_insurance_from_mango_depository.rs +++ b/programs/uxd/src/instructions/mango_dex/withdraw_insurance_from_mango_depository.rs @@ -12,8 +12,14 @@ use crate::INSURANCE_PASSTHROUGH_NAMESPACE; use crate::MangoDepository; use crate::UxdResult; use crate::mango_program; +use crate::error::check_assert; +use crate::error::UxdErrorCode; +use crate::error::SourceFileId; use crate::error::UxdIdlErrorCode; use crate::events::WithdrawInsuranceFromMangoDeposirotyEvent; + +declare_check_assert_macros!(SourceFileId::InstructionMangoDexWithdrawInsuranceFromMangoDepository); + #[derive(Accounts)] pub struct WithdrawInsuranceFromMangoDepository<'info> { pub authority: Signer<'info>, @@ -170,4 +176,16 @@ impl<'info> WithdrawInsuranceFromMangoDepository<'info> { .update_insurance_amount_deposited(&AccountingEvent::Withdraw, insurance_delta)?; Ok(()) } -} \ No newline at end of file +} + +// Validate +impl<'info> WithdrawInsuranceFromMangoDepository<'info> { + pub fn validate( + &self, + insurance_amount: u64, + ) -> ProgramResult { + check!(insurance_amount > 0, UxdErrorCode::InvalidInsuranceAmount)?; + // Mango withdraw will fail with proper error thanks to `disabled borrow` set to true if the balance is not enough. + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/set_mango_depositories_redeemable_soft_cap.rs b/programs/uxd/src/instructions/set_mango_depositories_redeemable_soft_cap.rs index eb45cb2a2..a63b3d113 100644 --- a/programs/uxd/src/instructions/set_mango_depositories_redeemable_soft_cap.rs +++ b/programs/uxd/src/instructions/set_mango_depositories_redeemable_soft_cap.rs @@ -1,9 +1,16 @@ use anchor_lang::prelude::*; -use crate::{Controller, UxdResult}; +use crate::Controller; +use crate::UxdResult; +use crate::MAX_MANGO_DEPOSITORIES_REDEEMABLE_SOFT_CAP; +use crate::error::check_assert; +use crate::error::UxdErrorCode; +use crate::error::SourceFileId; use crate::error::UxdIdlErrorCode; use crate::CONTROLLER_NAMESPACE; use crate::events::SetMangoDepositoryRedeemableSoftCapEvent; +declare_check_assert_macros!(SourceFileId::InstructionSetMangoDepositoriesRedeemableSoftCap); + #[derive(Accounts)] pub struct SetMangoDepositoriesRedeemableSoftCap<'info> { pub authority: Signer<'info>, @@ -29,4 +36,19 @@ pub fn handler( redeemable_soft_cap }); Ok(()) -} \ No newline at end of file +} + +// Validate +impl<'info> SetMangoDepositoriesRedeemableSoftCap<'info> { + // Asserts that the Mango Depositories redeemable soft cap is between 0 and MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP. + pub fn validate( + &self, + redeemable_soft_cap: u64, + ) -> ProgramResult { + check!( + redeemable_soft_cap <= MAX_MANGO_DEPOSITORIES_REDEEMABLE_SOFT_CAP, + UxdErrorCode::InvalidMangoDepositoriesRedeemableSoftCap + )?; + Ok(()) + } +} diff --git a/programs/uxd/src/instructions/set_redeemable_global_supply_cap.rs b/programs/uxd/src/instructions/set_redeemable_global_supply_cap.rs index 39dfce3b3..0d14345bf 100644 --- a/programs/uxd/src/instructions/set_redeemable_global_supply_cap.rs +++ b/programs/uxd/src/instructions/set_redeemable_global_supply_cap.rs @@ -1,9 +1,16 @@ use anchor_lang::prelude::*; -use crate::{Controller, UxdResult}; +use crate::Controller; +use crate::UxdResult; +use crate::MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP; +use crate::error::check_assert; +use crate::error::UxdErrorCode; +use crate::error::SourceFileId; use crate::error::UxdIdlErrorCode; use crate::CONTROLLER_NAMESPACE; use crate::events::SetRedeemableGlobalSupplyCapEvent; +declare_check_assert_macros!(SourceFileId::InstructionSetRedeemableGlobalSupplyCap); + #[derive(Accounts)] pub struct SetRedeemableGlobalSupplyCap<'info> { pub authority: Signer<'info>, @@ -27,4 +34,19 @@ pub fn handler( redeemable_global_supply_cap }); Ok(()) -} \ No newline at end of file +} + +// Validate +impl<'info> SetRedeemableGlobalSupplyCap<'info> { + // Asserts that the redeemable global supply cap is between 0 and MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP. + pub fn validate( + &self, + redeemable_global_supply_cap: u128, + ) -> ProgramResult { + check!( + redeemable_global_supply_cap <= MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP, + UxdErrorCode::InvalidRedeemableGlobalSupplyCap + )?; + Ok(()) + } +} diff --git a/programs/uxd/src/lib.rs b/programs/uxd/src/lib.rs index 39fb7e481..0a2f86087 100644 --- a/programs/uxd/src/lib.rs +++ b/programs/uxd/src/lib.rs @@ -16,7 +16,7 @@ pub mod mango_utils; pub mod state; #[cfg(feature = "development")] -solana_program::declare_id!("Hto7hH47haUP3Vrinym98BHkVdC3jtYWLXUhmfBSBT5N"); +solana_program::declare_id!("4jv7rFE2DJ7HXDtJ812xLLnugXjPTU4iSpBUq8Dm6uEM"); #[cfg(feature = "production")] solana_program::declare_id!("UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr"); @@ -37,6 +37,9 @@ pub const DEFAULT_REDEEMABLE_GLOBAL_SUPPLY_CAP: u128 = 1_000_000; // 1 Million r pub const MAX_MANGO_DEPOSITORIES_REDEEMABLE_SOFT_CAP: u64 = u64::MAX; pub const DEFAULT_MANGO_DEPOSITORIES_REDEEMABLE_SOFT_CAP: u64 = 10_000; // 10 Thousand redeemable UI units +const SLIPPAGE_BASIS: u32 = 1000; +const SOLANA_MAX_MINT_DECIMALS: u8 = 9; + pub type UxdResult = Result; declare_check_assert_macros!(SourceFileId::Lib); @@ -48,7 +51,7 @@ pub mod uxd { use super::*; // Initialize a Controller instance. - #[access_control(valid_redeemable_mint_decimals(redeemable_mint_decimals))] + #[access_control(ctx.accounts.validate(redeemable_mint_decimals))] pub fn initialize_controller( ctx: Context, bump: u8, @@ -71,7 +74,7 @@ pub mod uxd { // // Goal is to roll out progressively, and limit risks. // If this is set below the current circulating supply of UXD, it would effectively pause Minting. - #[access_control(valid_redeemable_global_supply_cap(redeemable_global_supply_cap))] + #[access_control(ctx.accounts.validate(redeemable_global_supply_cap))] pub fn set_redeemable_global_supply_cap( ctx: Context, redeemable_global_supply_cap: u128, @@ -88,7 +91,7 @@ pub mod uxd { // Goal is to roll out progressively, and limit risks. // If this is set to 0, it would effectively pause Minting. // Note : This would effectively pause minting. - #[access_control(valid_mango_depositories_redeemable_soft_cap(redeemable_soft_cap))] + #[access_control(ctx.accounts.validate(redeemable_soft_cap))] pub fn set_mango_depositories_redeemable_soft_cap( ctx: Context, redeemable_soft_cap: u64, @@ -125,9 +128,7 @@ pub mod uxd { }) } - #[access_control( - check_deposit_insurance_amount_constraints(&ctx, insurance_amount) - )] + #[access_control(ctx.accounts.validate(insurance_amount))] pub fn deposit_insurance_to_mango_depository( ctx: Context, insurance_amount: u64, @@ -141,7 +142,7 @@ pub mod uxd { } // Withdraw insurance previously deposited, if any available, in the limit of mango health. - #[access_control(check_withdraw_insurance_amount_constraints(insurance_amount))] + #[access_control(ctx.accounts.validate(insurance_amount))] pub fn withdraw_insurance_from_mango_depository( ctx: Context, insurance_amount: u64, @@ -178,8 +179,7 @@ pub mod uxd { // Mint Redeemable tokens by depositing Collateral to mango and opening the equivalent short perp position. // Callers pays taker_fees, that are deducted from the returned redeemable tokens (and part of the delta neutral position) #[access_control( - valid_slippage(slippage) - check_collateral_amount_constraints(&ctx, collateral_amount) + ctx.accounts.validate(collateral_amount, slippage) )] pub fn mint_with_mango_depository( ctx: Context, @@ -197,8 +197,7 @@ pub mod uxd { // Burn Redeemable tokens and return the equivalent quote value of Collateral by unwinding a part of the delta neutral position. // Callers pays taker_fees. #[access_control( - valid_slippage(slippage) - check_redeemable_amount_constraints(&ctx, redeemable_amount) + ctx.accounts.validate(redeemable_amount, slippage) )] pub fn redeem_from_mango_depository( ctx: Context, @@ -213,91 +212,12 @@ pub mod uxd { } } -// MARK: - ACCESS CONTROL ---------------------------------------------------- - -const SLIPPAGE_BASIS: u32 = 1000; -const SOLANA_MAX_MINT_DECIMALS: u8 = 9; - -// Asserts that the redeemable mint decimals is between 0 and 9. -fn valid_redeemable_mint_decimals<'info>(decimals: u8) -> ProgramResult { - check!( - decimals <= SOLANA_MAX_MINT_DECIMALS, - UxdErrorCode::InvalidRedeemableMintDecimals - )?; - Ok(()) -} - -// Asserts that the redeemable global supply cap is between 0 and MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP. -fn valid_redeemable_global_supply_cap<'info>(redeemable_global_supply_cap: u128) -> ProgramResult { - check!( - redeemable_global_supply_cap <= MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP, - UxdErrorCode::InvalidRedeemableGlobalSupplyCap - )?; - Ok(()) -} - -// Asserts that the Mango Depositories redeemable soft cap is between 0 and MAX_REDEEMABLE_GLOBAL_SUPPLY_CAP. -fn valid_mango_depositories_redeemable_soft_cap<'info>(redeemable_soft_cap: u64) -> ProgramResult { - check!( - redeemable_soft_cap <= MAX_MANGO_DEPOSITORIES_REDEEMABLE_SOFT_CAP, - UxdErrorCode::InvalidMangoDepositoriesRedeemableSoftCap - )?; - Ok(()) -} - -// Asserts that the amount of usdc for the operation is above 0. -// Asserts that the amount of usdc is available in the user account. -fn valid_slippage<'info>(slippage: u32) -> ProgramResult { - check!(slippage <= SLIPPAGE_BASIS, UxdErrorCode::InvalidSlippage)?; - Ok(()) -} - -pub fn check_collateral_amount_constraints<'info>( - ctx: &Context>, - collateral_amount: u64, -) -> ProgramResult { - check!(collateral_amount > 0, UxdErrorCode::InvalidCollateralAmount)?; - check!( - ctx.accounts.user_collateral.amount >= collateral_amount, - UxdErrorCode::InsufficientCollateralAmount - )?; - Ok(()) -} - -pub fn check_redeemable_amount_constraints<'info>( - ctx: &Context>, - redeemable_amount: u64, -) -> ProgramResult { - check!(redeemable_amount > 0, UxdErrorCode::InvalidRedeemableAmount)?; - check!( - ctx.accounts.user_redeemable.amount >= redeemable_amount, - UxdErrorCode::InsufficientRedeemableAmount - )?; - Ok(()) -} - -pub fn check_deposit_insurance_amount_constraints<'info>( - ctx: &Context>, - insurance_amount: u64, -) -> ProgramResult { - check!(insurance_amount > 0, UxdErrorCode::InvalidInsuranceAmount)?; - check!( - ctx.accounts.authority_insurance.amount >= insurance_amount, - UxdErrorCode::InsufficientAuthorityInsuranceAmount - )?; - Ok(()) -} - -pub fn check_withdraw_insurance_amount_constraints<'info>(insurance_amount: u64) -> ProgramResult { - check!(insurance_amount > 0, UxdErrorCode::InvalidInsuranceAmount)?; - // Mango withdraw will fail with proper error thanks to `disabled borrow` set to true if the balance is not enough. - Ok(()) -} - -pub fn check_max_rebalancing_amount_constraints(max_rebalancing_amount: u64) -> ProgramResult { - check!( - max_rebalancing_amount > 0, - UxdErrorCode::InvalidRebalancedAmount - )?; - Ok(()) -} +// WIP: on branch : feature/rebalancing +// More info above with rebalance_mango_depository function +// pub fn check_max_rebalancing_amount_constraints(max_rebalancing_amount: u64) -> ProgramResult { +// check!( +// max_rebalancing_amount > 0, +// UxdErrorCode::InvalidRebalancedAmount +// )?; +// Ok(()) +// } diff --git a/target/deploy/uxd-keypair.json b/target/deploy/uxd-keypair.json index dafe0a523..cb522c25e 100644 --- a/target/deploy/uxd-keypair.json +++ b/target/deploy/uxd-keypair.json @@ -1 +1 @@ -[85,212,86,10,163,111,113,26,188,64,172,53,3,179,37,203,123,67,69,76,216,39,119,179,139,12,175,161,80,161,198,113,250,255,193,68,227,124,151,140,205,40,241,79,212,249,165,119,163,48,43,19,232,134,34,16,238,70,189,191,161,249,60,133] \ No newline at end of file +[84,46,234,18,158,164,89,226,135,155,38,232,76,201,198,139,243,146,32,68,124,3,231,33,206,40,43,90,127,1,74,139,55,145,131,252,149,27,154,137,4,189,230,97,129,143,101,89,113,136,128,241,210,187,30,13,226,128,157,116,224,144,202,30] \ No newline at end of file diff --git a/target/idl/uxd.json b/target/idl/uxd.json index 19fe78636..540f1a0dc 100644 --- a/target/idl/uxd.json +++ b/target/idl/uxd.json @@ -1325,6 +1325,6 @@ } ], "metadata": { - "address": "Hto7hH47haUP3Vrinym98BHkVdC3jtYWLXUhmfBSBT5N" + "address": "4jv7rFE2DJ7HXDtJ812xLLnugXjPTU4iSpBUq8Dm6uEM" } } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index f05a27663..2de221d62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -46,17 +46,17 @@ "@ethersproject/logger" "^5.5.0" hash.js "1.1.7" -"@project-serum/anchor@^0.11.1": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.11.1.tgz#155bff2c70652eafdcfd5559c81a83bb19cec9ff" - integrity sha512-oIdm4vTJkUy6GmE6JgqDAuQPKI7XM4TPJkjtoIzp69RZe0iAD9JP2XHx7lV1jLdYXeYHqDXfBt3zcq7W91K6PA== +"@project-serum/anchor@0.20.0", "@project-serum/anchor@^0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.20.0.tgz#547f5c0ff7e66809fa7118b2e3abd8087b5ec519" + integrity sha512-p1KOiqGBIbNsopMrSVoPwgxR1iPffsdjMNCOysahTPL9whX2CLX9HQCdopHjYaGl7+SdHRuXml6Wahk/wUmC8g== dependencies: "@project-serum/borsh" "^0.2.2" "@solana/web3.js" "^1.17.0" base64-js "^1.5.1" bn.js "^5.1.2" bs58 "^4.0.1" - buffer-layout "^1.2.0" + buffer-layout "^1.2.2" camelcase "^5.3.1" crypto-hash "^1.3.0" eventemitter3 "^4.0.7" @@ -66,10 +66,10 @@ snake-case "^3.0.4" toml "^3.0.0" -"@project-serum/anchor@^0.16.2": - version "0.16.2" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.16.2.tgz#b8b4ec4c749d59a224108f8d82ab68217ef752ae" - integrity sha512-wOJwObd4wOZ5tRRMCKYjeMNsEmf7vuC71KQRnw6wthhErL8c/818n4gYIZCf/1ZPl/8WPruIlmtQHDSEyy2+0Q== +"@project-serum/anchor@^0.11.1": + version "0.11.1" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.11.1.tgz#155bff2c70652eafdcfd5559c81a83bb19cec9ff" + integrity sha512-oIdm4vTJkUy6GmE6JgqDAuQPKI7XM4TPJkjtoIzp69RZe0iAD9JP2XHx7lV1jLdYXeYHqDXfBt3zcq7W91K6PA== dependencies: "@project-serum/borsh" "^0.2.2" "@solana/web3.js" "^1.17.0" @@ -86,17 +86,17 @@ snake-case "^3.0.4" toml "^3.0.0" -"@project-serum/anchor@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.20.0.tgz#547f5c0ff7e66809fa7118b2e3abd8087b5ec519" - integrity sha512-p1KOiqGBIbNsopMrSVoPwgxR1iPffsdjMNCOysahTPL9whX2CLX9HQCdopHjYaGl7+SdHRuXml6Wahk/wUmC8g== +"@project-serum/anchor@^0.16.2": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.16.2.tgz#b8b4ec4c749d59a224108f8d82ab68217ef752ae" + integrity sha512-wOJwObd4wOZ5tRRMCKYjeMNsEmf7vuC71KQRnw6wthhErL8c/818n4gYIZCf/1ZPl/8WPruIlmtQHDSEyy2+0Q== dependencies: "@project-serum/borsh" "^0.2.2" "@solana/web3.js" "^1.17.0" base64-js "^1.5.1" bn.js "^5.1.2" bs58 "^4.0.1" - buffer-layout "^1.2.2" + buffer-layout "^1.2.0" camelcase "^5.3.1" crypto-hash "^1.3.0" eventemitter3 "^4.0.7" @@ -267,12 +267,13 @@ resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== -"@uxdprotocol/uxd-client@^4.7.0": - version "4.7.0" - resolved "https://npm.pkg.github.com/download/@uxdprotocol/uxd-client/4.7.0/829192e42a0b2c2f7e5b06b9a059c60bf3366804054a73434489077be3df6188#db588cae6292e8157cf981ac2ac7eeeb1be82276" - integrity sha512-rODyTWoS/QMTc8Wv0QHa2dxkRiYAuQ4PC4bn6wjM73ekwgaQFka3uV0FFr10+D7BPOTs79GqtS4eYxJqRSj4Fg== +"@uxdprotocol/uxd-client@^4.8.0": + version "4.10.0" + resolved "https://npm.pkg.github.com/download/@uxdprotocol/uxd-client/4.10.0/9d0a6f2286b67ca56fad70c4269cf96dd758525ffbfb7768f6b952ec9e9794f3#8b3fab7c620a662890dd00a311af3d0b4cbe3434" + integrity sha512-GKf/4fUkdbp67mUTB2kVysxL5EnYuwlkzmAV8YstLRdzPSUZfegwN27doPL+u4eXB3PAcidYzJBpvkg2VLdgwQ== dependencies: "@blockworks-foundation/mango-client" "3.2.15" + "@project-serum/anchor" "0.20.0" camelcase "^5.3.1" JSONStream@^1.3.5: