Skip to main content

Module sui::accumulator_settlement

use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::vector;
use sui::accumulator;
use sui::address;
use sui::bcs;
use sui::dynamic_field;
use sui::hash;
use sui::hex;
use sui::object;
use sui::party;
use sui::transfer;
use sui::tx_context;
use sui::vec_map;

Struct EventStreamHead

public struct EventStreamHead has store
Click to open
Fields
mmr: vector<u256>
Merkle Mountain Range of all events in the stream.
checkpoint_seq: u64
Checkpoint sequence number at which the event stream was written.
num_events: u64
Number of events in the stream.

Constants

const ENotSystemAddress: u64 = 0;
const EInvalidSplitAmount: u64 = 1;

Function settlement_prologue

Called by settlement transactions to ensure that the settlement transaction has a unique digest.

fun settlement_prologue(_accumulator_root: &mut sui::accumulator::AccumulatorRoot, _epoch: u64, _checkpoint_height: u64, _idx: u64, input_sui: u64, output_sui: u64, ctx: &sui::tx_context::TxContext)

Function settle_u128

fun settle_u128<T>(accumulator_root: &mut sui::accumulator::AccumulatorRoot, owner: address, merge: u128, split: u128, ctx: &sui::tx_context::TxContext)

Function record_settlement_sui_conservation

Called by the settlement transaction to track conservation of SUI.

fun record_settlement_sui_conservation(input_sui: u64, output_sui: u64)

Function add_to_mmr

fun add_to_mmr(new_val: u256, mmr: &mut vector<u256>)

Function u256_from_bytes

fun u256_from_bytes(bytes: vector<u8>): u256

Function hash_two_to_one_u256

fun hash_two_to_one_u256(left: u256, right: u256): u256

Function new_stream_head

fun new_stream_head(new_root: u256, event_count_delta: u64, checkpoint_seq: u64): sui::accumulator_settlement::EventStreamHead

Function settle_events

fun settle_events(accumulator_root: &mut sui::accumulator::AccumulatorRoot, stream_id: address, new_root: u256, event_count_delta: u64, checkpoint_seq: u64, ctx: &sui::tx_context::TxContext)