Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update program comments to remove typos #114 #115

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion programs/amm/src/instructions/collect_remaining_rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub const COLLECT_REMAINING_MEMO_MSG: &'static [u8] = b"raydium_collect_remainin

#[derive(Accounts)]
pub struct CollectRemainingRewards<'info> {
/// The founder who init reward info in berfore
/// The founder who init reward info previously
pub reward_funder: Signer<'info>,
/// The funder's reward token account
#[account(mut)]
Expand Down
2 changes: 1 addition & 1 deletion programs/amm/src/instructions/open_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ pub fn open_position<'a, 'b, 'c: 'info, 'info>(
)?
};

// check if protocol position is initilized
// check if protocol position is initialized
let protocol_position = protocol_position.deref_mut();
if protocol_position.pool_id == Pubkey::default() {
protocol_position.bump = protocol_position_bump;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ pub struct OpenPositionWithToken22Nft<'info> {
/// CHECK: Receives the position NFT
pub position_nft_owner: UncheckedAccount<'info>,

/// Unique token mint address, initialize in constract
/// Unique token mint address, initialize in contract
#[account(mut)]
pub position_nft_mint: Signer<'info>,

/// CHECK: ATA address where position NFT will be minted, initialize in constract
/// CHECK: ATA address where position NFT will be minted, initialize in contract
#[account(mut)]
pub position_nft_account: UncheckedAccount<'info>,

Expand Down
2 changes: 1 addition & 1 deletion programs/amm/src/instructions/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ pub fn swap_internal<'b, 'info>(
}

/// Performs a single exact input/output swap
/// if is_base_input = true, return vaule is the max_amount_out, otherwise is min_amount_in
/// if is_base_input = true, return value is the max_amount_out, otherwise is min_amount_in
pub fn exact_internal<'b, 'c: 'info, 'info>(
ctx: &mut SwapAccounts<'b, 'info>,
remaining_accounts: &'c [AccountInfo<'info>],
Expand Down
4 changes: 2 additions & 2 deletions programs/amm/src/instructions/swap_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct SwapSingleV2<'info> {
}

/// Performs a single exact input/output swap
/// if is_base_input = true, return vaule is the max_amount_out, otherwise is min_amount_in
/// if is_base_input = true, return value is the max_amount_out, otherwise is min_amount_in
pub fn exact_internal_v2<'c: 'info, 'info>(
ctx: &mut SwapSingleV2<'info>,
remaining_accounts: &'c [AccountInfo<'info>],
Expand All @@ -96,7 +96,7 @@ pub fn exact_internal_v2<'c: 'info, 'info>(
let input_balance_before = ctx.input_token_account.amount;
let output_balance_before = ctx.output_token_account.amount;

// calculate specified amount because the amount includes thransfer_fee as input and without thransfer_fee as output
// calculate specified amount because the amount includes transfer_fee as input and without transfer_fee as output
let amount_calculate_specified = if is_base_input {
let transfer_fee =
util::get_transfer_fee(ctx.input_vault_mint.clone(), amount_specified).unwrap();
Expand Down
30 changes: 15 additions & 15 deletions programs/amm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ pub mod amm_v3 {

use super::*;

// The configuation of AMM protocol, include trade fee and protocol fee
// The configuration of AMM protocol, include trade fee and protocol fee
/// # Arguments
///
/// * `ctx`- The accounts needed by instruction.
/// * `index` - The index of amm config, there may be multiple config.
/// * `tick_spacing` - The tickspacing binding with config, cannot be changed.
/// * `trade_fee_rate` - Trade fee rate, can be changed.
/// * `protocol_fee_rate` - The rate of protocol fee within tarde fee.
/// * `fund_fee_rate` - The rate of fund fee within tarde fee.
/// * `protocol_fee_rate` - The rate of protocol fee within trade fee.
/// * `fund_fee_rate` - The rate of fund fee within trade fee.
///
pub fn create_amm_config(
ctx: Context<CreateAmmConfig>,
Expand Down Expand Up @@ -81,7 +81,7 @@ pub mod amm_v3 {
/// * `fund_fee_rate`- The new fund fee rate of amm config, be set when `param` is 2
/// * `new_owner`- The config's new owner, be set when `param` is 3
/// * `new_fund_owner`- The config's new fund owner, be set when `param` is 4
/// * `param`- The vaule can be 0 | 1 | 2 | 3 | 4, otherwise will report a error
/// * `param`- The value can be 0 | 1 | 2 | 3 | 4, otherwise will report a error
///
pub fn update_amm_config(ctx: Context<UpdateAmmConfig>, param: u8, value: u32) -> Result<()> {
instructions::update_amm_config(ctx, param, value)
Expand All @@ -102,12 +102,12 @@ pub mod amm_v3 {
instructions::create_pool(ctx, sqrt_price_x64, open_time)
}

/// Update pool status for given vaule
/// Update pool status for given value
///
/// # Arguments
///
/// * `ctx`- The context of accounts
/// * `status` - The vaule of status
/// * `status` - The value of status
///
pub fn update_pool_status(ctx: Context<UpdatePoolStatus>, status: u8) -> Result<()> {
instructions::update_pool_status(ctx, status)
Expand All @@ -128,7 +128,7 @@ pub mod amm_v3 {
/// # Arguments
///
/// * `ctx`- The context of accounts
/// * `param`- The vaule can be 0 | 1 | 2 | 3, otherwise will report a error
/// * `param`- The value can be 0 | 1 | 2 | 3, otherwise will report a error
/// * `keys`- update operation owner when the `param` is 0
/// remove operation owner when the `param` is 1
/// update whitelist mint when the `param` is 2
Expand Down Expand Up @@ -199,15 +199,15 @@ pub mod amm_v3 {
instructions::update_reward_infos(ctx)
}

/// Restset reward param, start a new reward cycle or extend the current cycle.
/// Reset reward param, start a new reward cycle or extend the current cycle.
///
/// # Arguments
///
/// * `ctx` - The context of accounts
/// * `reward_index` - The index of reward token in the pool.
/// * `emissions_per_second_x64` - The per second emission reward, when extend the current cycle,
/// new value can't be less than old value
/// * `open_time` - reward open timestamp, must be set when state a new cycle
/// * `open_time` - reward open timestamp, must be set when starting a new cycle
/// * `end_time` - reward end timestamp
///
pub fn set_reward_params<'a, 'b, 'c: 'info, 'info>(
Expand Down Expand Up @@ -306,7 +306,7 @@ pub mod amm_v3 {
/// * `tick_upper_index` - The upper boundary of market
/// * `tick_array_lower_start_index` - The start index of tick array which include tick low
/// * `tick_array_upper_start_index` - The start index of tick array which include tick upper
/// * `liquidity` - The liquidity to be added, if zero, and the base_flage is specified, calculate liquidity base amount_0_max or amount_1_max according base_flag, otherwise open position with zero liquidity
/// * `liquidity` - The liquidity to be added, if zero, and the base_flag is specified, calculate liquidity base amount_0_max or amount_1_max according base_flag, otherwise open position with zero liquidity
/// * `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check
/// * `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check
/// * `with_metadata` - The flag indicating whether to create NFT mint metadata
Expand Down Expand Up @@ -347,7 +347,7 @@ pub mod amm_v3 {
/// * `tick_upper_index` - The upper boundary of market
/// * `tick_array_lower_start_index` - The start index of tick array which include tick low
/// * `tick_array_upper_start_index` - The start index of tick array which include tick upper
/// * `liquidity` - The liquidity to be added, if zero, and the base_flage is specified, calculate liquidity base amount_0_max or amount_1_max according base_flag, otherwise open position with zero liquidity
/// * `liquidity` - The liquidity to be added, if zero, and the base_flag is specified, calculate liquidity base amount_0_max or amount_1_max according base_flag, otherwise open position with zero liquidity
/// * `amount_0_max` - The max amount of token_0 to spend, which serves as a slippage check
/// * `amount_1_max` - The max amount of token_1 to spend, which serves as a slippage check
/// * `with_metadata` - The flag indicating whether to create NFT mint metadata
Expand Down Expand Up @@ -392,7 +392,7 @@ pub mod amm_v3 {
}

/// #[deprecated(note = "Use `increase_liquidity_v2` instead.")]
/// Increases liquidity with a exist position, with amount paid by `payer`
/// Increases liquidity for an existing position, with amount paid by `payer`
///
/// # Arguments
///
Expand All @@ -411,7 +411,7 @@ pub mod amm_v3 {
instructions::increase_liquidity_v1(ctx, liquidity, amount_0_max, amount_1_max, None)
}

/// Increases liquidity with a exist position, with amount paid by `payer`, support Token2022
/// Increases liquidity for an existing position, with amount paid by `payer`, support Token2022
///
/// # Arguments
///
Expand All @@ -435,7 +435,7 @@ pub mod amm_v3 {
}

/// #[deprecated(note = "Use `decrease_liquidity_v2` instead.")]
/// Decreases liquidity with a exist position
/// Decreases liquidity for an existing position
///
/// # Arguments
///
Expand All @@ -453,7 +453,7 @@ pub mod amm_v3 {
instructions::decrease_liquidity_v1(ctx, liquidity, amount_0_min, amount_1_min)
}

/// Decreases liquidity with a exist position, support Token2022
/// Decreases liquidity for an existing position, support Token2022
///
/// # Arguments
///
Expand Down
2 changes: 1 addition & 1 deletion programs/amm/src/states/tick_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl TickArrayState {
)
.0
}
/// Load a TickArrayState of type AccountLoader from tickarray account info, if tickarray account is not exist, then create it.
/// Load a TickArrayState of type AccountLoader from tickarray account info, if tickarray account does not exist, then create it.
pub fn get_or_create_tick_array<'info>(
payer: AccountInfo<'info>,
tick_array_account_info: AccountInfo<'info>,
Expand Down