#[repr(C)]pub struct Treasury {
pub balance: u64,
pub total_spirit_power: u64,
pub total_shards_burned: u64,
pub total_refined: u64,
pub last_emission_slot: u64,
pub total_effective_spirit_power: u64,
pub xp_reward_pool: u64,
pub total_xp: u64,
}Fields§
§balance: u64Treasury SOL balance (lamports) for buybacks.
total_spirit_power: u64Total Spirit Power of all assigned shoguns (for % display).
total_shards_burned: u64Total in-game soft currency burned (dine, upgrades, shop). Not raw SPL-only transfers.
total_refined: u64Total $DOJO minted to players from claim_shards (cumulative).
last_emission_slot: u64Last slot at which emission was run (keeper / gameplay). Used to compute next emission.
total_effective_spirit_power: u64Sum of each dojo’s dojo-wide effective SP: effective_spirit_power_with_scene(sum_raw, scene).
Must match how claim_shards weights users (one flat/pct bonus per dojo, not per shogun).
xp_reward_pool: u64SOL (lamports) earmarked for XP reward claims (subset of balance accounting).
total_xp: u64Sum of all dojos’ dojo.xp (stake + activity reward points). Weight for claim_xp_rewards SOL share.
Implementations§
Source§impl Treasury
impl Treasury
Sourcepub fn credit_sol_from_protocol_revenue(&mut self, lamports: u64)
pub fn credit_sol_from_protocol_revenue(&mut self, lamports: u64)
Credits balance and xp_reward_pool together when lamports arrive from the standard
protocol SOL split (to_treasury, or to_staking when routed to treasury with no stakers).
Sourcepub fn effective_spirit_power_with_scene(raw_sp: u64, scene_id: u64) -> u64
pub fn effective_spirit_power_with_scene(raw_sp: u64, scene_id: u64) -> u64
Effective SP for pool-split: (raw_sp + flat_bonus) * (1 + pct_bps/10000). Used so scene bonuses shift share without increasing total emissions.
Trait Implementations§
Source§impl AccountValidation for Treasury
impl AccountValidation for Treasury
fn assert<F>(&self, condition: F) -> Result<&Self, ProgramError>
fn assert_err<F>( &self, condition: F, err: ProgramError, ) -> Result<&Self, ProgramError>
fn assert_msg<F>(&self, condition: F, msg: &str) -> Result<&Self, ProgramError>
fn assert_mut<F>(&mut self, condition: F) -> Result<&mut Self, ProgramError>
fn assert_mut_err<F>( &mut self, condition: F, err: ProgramError, ) -> Result<&mut Self, ProgramError>
fn assert_mut_msg<F>( &mut self, condition: F, msg: &str, ) -> Result<&mut Self, ProgramError>
Source§impl Discriminator for Treasury
impl Discriminator for Treasury
fn discriminator() -> u8
impl Copy for Treasury
impl Pod for Treasury
impl StructuralPartialEq for Treasury
Auto Trait Implementations§
impl Freeze for Treasury
impl RefUnwindSafe for Treasury
impl Send for Treasury
impl Sync for Treasury
impl Unpin for Treasury
impl UnsafeUnpin for Treasury
impl UnwindSafe for Treasury
Blanket Implementations§
Source§impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountDeserialize for Twhere
T: Discriminator + Pod,
fn try_from_bytes(data: &[u8]) -> Result<&T, ProgramError>
fn try_from_bytes_mut(data: &mut [u8]) -> Result<&mut T, ProgramError>
Source§impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
impl<T> AccountHeaderDeserialize for Twhere
T: Discriminator + Pod,
fn try_header_from_bytes(data: &[u8]) -> Result<(&T, &[u8]), ProgramError>
fn try_header_from_bytes_mut( data: &mut [u8], ) -> Result<(&mut T, &mut [u8]), ProgramError>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more