add dxl stake (#16)

This commit is contained in:
ray 2021-07-28 16:50:31 +09:00 committed by GitHub
parent 9dfcf20a64
commit f69fb29f16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -378,7 +378,14 @@ mod registry {
if ctx.accounts.clock.unix_timestamp >= expiry_ts {
return Err(ErrorCode::InvalidExpiry.into());
}
if ctx.accounts.registrar.to_account_info().key == &fida_registrar::ID {
if ctx.accounts.registrar.to_account_info().key == &dxl_registrar::ID {
if ctx.accounts.vendor_vault.mint != dxl_mint::ID {
return Err(ErrorCode::InvalidMint.into());
}
if total < DXL_MIN_REWARD {
return Err(ErrorCode::InsufficientReward.into());
}
} else if ctx.accounts.registrar.to_account_info().key == &fida_registrar::ID {
if ctx.accounts.vendor_vault.mint != fida_mint::ID {
return Err(ErrorCode::InvalidMint.into());
}
@ -1379,6 +1386,7 @@ pub fn no_available_rewards<'info>(
// Native units.
pub const SRM_MIN_REWARD: u64 = 500_000_000;
pub const FIDA_MIN_REWARD: u64 = 900_000_000;
pub const DXL_MIN_REWARD: u64 = 900_000_000;
pub mod srm_registrar {
solana_program::declare_id!("5vJRzKtcp4fJxqmR7qzajkaKSiAb6aT9grRsaZKXU222");
@ -1389,9 +1397,15 @@ pub mod msrm_registrar {
pub mod fida_registrar {
solana_program::declare_id!("5C2ayX1E2SJ5kKEmDCA9ue9eeo3EPR34QFrhyzbbs3qh");
}
pub mod dxl_registrar {
solana_program::declare_id!("BQtp3xGPTFXJSt1MVKxtVSefRcBWmUkzTNM3g1t9efcK");
}
pub mod srm_mint {
solana_program::declare_id!("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt");
}
pub mod fida_mint {
solana_program::declare_id!("EchesyfXePKdLtoiZSL8pBe8Myagyy8ZRqsACNCFGnvp");
}
pub mod dxl_mint {
solana_program::declare_id!("GsNzxJfFn6zQdJGeYsupJWzUAm57Ba7335mfhWvFiE9Z");
}