Module sui::accumulator
use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::vector;
use sui::address;
use sui::dynamic_field;
use sui::hex;
use sui::object;
use sui::party;
use sui::transfer;
use sui::tx_context;
use sui::vec_map;
Struct AccumulatorRoot
public struct AccumulatorRoot has key
Click to open
Fields
- id: sui::object::UID
Struct U128
Storage for 128-bit accumulator values.
Currently only used to represent the sum of 64 bit values (such as Balance<T>).
The additional bits are necessary to prevent overflow, as it would take 2^64 deposits of U64_MAX
to cause an overflow.
public struct U128 has store
Click to open
Fields
- value: u128
Struct Key
Key is used only for computing the field id of accumulator objects. T is the type of the accumulated value, e.g. Balance<SUI>
public struct Key<phantom T> has copy, drop, store
Click to open
Fields
- address: address
Constants
const ENotSystemAddress: u64 = 0;
Function create
fun create(ctx: &sui::tx_context::TxContext)
Function root_id
public(package) fun root_id(accumulator_root: &sui::accumulator::AccumulatorRoot): &sui::object::UID
Function root_id_mut
public(package) fun root_id_mut(accumulator_root: &mut sui::accumulator::AccumulatorRoot): &mut sui::object::UID
Function accumulator_u128_exists
public(package) fun accumulator_u128_exists<T>(root: &sui::accumulator::AccumulatorRoot, address: address): bool