generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #191 from metaplex-foundation/feat/svm-fees
Scaling fees based on SVM native rent.
- Loading branch information
Showing
2 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
use solana_program::pubkey::Pubkey; | ||
use solana_program::{program_error::ProgramError, pubkey::Pubkey, rent::Rent, sysvar::Sysvar}; | ||
|
||
use crate::error::MplCoreError; | ||
|
||
pub(crate) const COLLECT_RECIPIENT1: Pubkey = | ||
solana_program::pubkey!("8AT6o8Qk5T9QnZvPThMrF9bcCQLTGkyGvVZZzHgCw11v"); | ||
|
||
pub(crate) const COLLECT_RECIPIENT2: Pubkey = | ||
solana_program::pubkey!("MmHsqX4LxTfifxoH8BVRLUKrwDn1LPCac6YcCZTHhwt"); | ||
|
||
pub(crate) const COLLECT_AMOUNT: u64 = 1_500_000; | ||
const CREATE_FEE_SCALAR: usize = 87; | ||
const CREATE_FEE_OFFSET: u64 = 3600; | ||
pub fn get_create_fee() -> Result<u64, ProgramError> { | ||
let rent = Rent::get()?.minimum_balance(CREATE_FEE_SCALAR); | ||
|
||
Ok(rent | ||
.checked_add(CREATE_FEE_OFFSET) | ||
.ok_or(MplCoreError::NumericalOverflowError)?) | ||
} |