mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-07 23:26:46 +00:00
supply limit
This commit is contained in:
@@ -14,7 +14,7 @@ pub fn process_boost(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
|||||||
let config = config_info
|
let config = config_info
|
||||||
.as_account_mut::<Config>(&ore_api::ID)?
|
.as_account_mut::<Config>(&ore_api::ID)?
|
||||||
.assert_mut(|c| clock.unix_timestamp >= c.last_boost + (10 * ONE_MINUTE))?;
|
.assert_mut(|c| clock.unix_timestamp >= c.last_boost + (10 * ONE_MINUTE))?;
|
||||||
mint_info.has_address(&MINT_ADDRESS)?.as_mint()?;
|
let mint = mint_info.has_address(&MINT_ADDRESS)?.as_mint()?;
|
||||||
reserve_tokens_info
|
reserve_tokens_info
|
||||||
.has_address(&BOOST_RESERVE_TOKEN)?
|
.has_address(&BOOST_RESERVE_TOKEN)?
|
||||||
.as_token_account()?
|
.as_token_account()?
|
||||||
@@ -26,12 +26,13 @@ pub fn process_boost(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
|||||||
config.last_boost = clock.unix_timestamp;
|
config.last_boost = clock.unix_timestamp;
|
||||||
|
|
||||||
// Mint tokens to the boost program.
|
// Mint tokens to the boost program.
|
||||||
|
let mint_amount = (3 * ONE_ORE).min(MAX_SUPPLY - mint.supply());
|
||||||
mint_to_signed(
|
mint_to_signed(
|
||||||
mint_info,
|
mint_info,
|
||||||
reserve_tokens_info,
|
reserve_tokens_info,
|
||||||
treasury_info,
|
treasury_info,
|
||||||
token_program,
|
token_program,
|
||||||
ONE_ORE * 3,
|
mint_amount,
|
||||||
&[TREASURY],
|
&[TREASURY],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user