Module 0x3::storage_fund
- Struct
StorageFund
- Function
new
- Function
advance_epoch
- Function
total_object_storage_rebates
- Function
total_balance
use 0x2::balance;
use 0x2::sui;
Struct StorageFund
Struct representing the storage fund, containing two Balances:
- total_object_storage_rebates has the invariant that it's the sum of storage_rebate of all objects currently stored on-chain. To maintain this invariant, the only inflow of this balance is storage charges collected from transactions, and the only outflow is storage rebates of transactions, including both the portion refunded to the transaction senders as well as the non-refundable portion taken out and put into non_refundable_balance.
- non_refundable_balance contains any remaining inflow of the storage fund that should not be taken out of the fund.
struct StorageFund has store
Click to open
Fields
Function new
Called by sui_system at genesis time.
public(friend) fun new(initial_fund: balance::Balance<sui::SUI>): storage_fund::StorageFund
Click to open
Implementation
Function advance_epoch
Called by sui_system at epoch change times to process the inflows and outflows of storage fund.
public(friend) fun advance_epoch(self: &mut storage_fund::StorageFund, storage_charges: balance::Balance<sui::SUI>, storage_fund_reinvestment: balance::Balance<sui::SUI>, leftover_staking_rewards: balance::Balance<sui::SUI>, storage_rebate_amount: u64, non_refundable_storage_fee_amount: u64): balance::Balance<sui::SUI>
Click to open
Implementation
Function total_object_storage_rebates
public fun total_object_storage_rebates(self: &storage_fund::StorageFund): u64
Click to open
Implementation
Function total_balance
public fun total_balance(self: &storage_fund::StorageFund): u64
Click to open