Skip to content

Latest commit

 

History

History
678 lines (284 loc) · 17 KB

bbn.md

File metadata and controls

678 lines (284 loc) · 17 KB

Module 0x4::bbn

Struct BBNGlobalParamV0

struct BBNGlobalParamV0 has copy, drop, store

Struct BBNGlobalParamV1

struct BBNGlobalParamV1 has copy, drop, store

Resource BBNGlobalParams

struct BBNGlobalParams has key

Struct BBNOpReturnOutput

struct BBNOpReturnOutput has copy, drop, store

Struct BBNV0OpReturnData

struct BBNV0OpReturnData has copy, drop, store

Resource BBNStakeSeal

struct BBNStakeSeal has key

Struct BBNScriptPaths

struct BBNScriptPaths has copy, drop, store

Struct BBNStakingEvent

struct BBNStakingEvent has copy, drop, store

Struct BBNStakingFailedEvent

struct BBNStakingFailedEvent has copy, drop, store

Struct BBNStakingUnbondingEvent

struct BBNStakingUnbondingEvent has copy, drop, store

Struct TempStateDropEvent

Event emitted when the temporary state of a BBNStakeSeal is dropped The temporary state is dropped when the UTXO is spent The event is onchain event, and the event_queue name is type_name of the temporary state

struct TempStateDropEvent has copy, drop, store

Constants

const ErrorInvalidThreshold: u64 = 11;

const TEMPORARY_AREA: vector<u8> = [116, 101, 109, 112, 111, 114, 97, 114, 121, 95, 97, 114, 101, 97];

const BBN_V1_ACTIVATION_HEIGHT: u64 = 864790;

const BBN_V1_CAP_HEIGHT: u64 = 864799;

const BBN_V2_ACTIVATION_HEIGHT: u64 = 874088;

const BBN_V2_CAP_HEIGHT: u64 = 875087;

const DeprecatedFunction: u64 = 16;

const ErrorAlreadyInit: u64 = 1;

const ErrorInvalidBytesLen: u64 = 7;

const ErrorInvalidKeysLen: u64 = 10;

const ErrorNoBabylonOpReturn: u64 = 4;

const ErrorNoBabylonStakingOutput: u64 = 14;

const ErrorNoBabylonUTXO: u64 = 2;

const ErrorNoKeysProvided: u64 = 9;

const ErrorNotBabylonTx: u64 = 8;

const ErrorOutBlockRange: u64 = 15;

const ErrorTransactionLockTime: u64 = 6;

const ErrorTransactionNotFound: u64 = 3;

const ErrorUTXOAlreadySealed: u64 = 13;

const UNSPENDABLEKEYPATHKEY: vector<u8> = [80, 146, 155, 116, 193, 160, 73, 84, 183, 139, 75, 96, 53, 233, 122, 94, 7, 138, 90, 15, 40, 236, 150, 213, 71, 191, 238, 154, 206, 128, 58, 192];

Function genesis_init

public(friend) fun genesis_init()

Function init_for_upgrade

public fun init_for_upgrade()

Function init_bbn_global_param_v2

BBN global param version 2 initialization

Function is_possible_bbn_tx

Deprecated function Use bbn_updater::is_possible_bbn_tx instead

public fun is_possible_bbn_tx(_txid: address): bool

Function is_possible_bbn_transaction

Check if the transaction is a possible Babylon transaction If the transaction contains an OP_RETURN output with the correct tag, it is considered a possible Babylon transaction

public fun is_possible_bbn_transaction(block_height: u64, tx: &types::Transaction): bool

Function process_bbn_tx_entry

Deprecated function Use bbn_updater::process_bbn_tx_entry instead

public entry fun process_bbn_tx_entry(_txid: address)

Function process_bbn_transaction

public(friend) fun process_bbn_transaction(block_height: u64, tx: &types::Transaction)

Function on_utxo_spend

public(friend) fun on_utxo_spend(utxo: &mut utxo::UTXO)

Function remove_bbn_seal

public(friend) fun remove_bbn_seal(seal_obj_id: object::ObjectID)

Function add_temp_state

#[private_generics(#[S])]
public fun add_temp_state<S: drop, store>(stake: &mut object::Object<bbn::BBNStakeSeal>, state: S)

Function contains_temp_state

public fun contains_temp_state<S: drop, store>(stake: &object::Object<bbn::BBNStakeSeal>): bool

Function borrow_temp_state

public fun borrow_temp_state<S: drop, store>(stake: &object::Object<bbn::BBNStakeSeal>): &S

Function borrow_mut_temp_state

#[private_generics(#[S])]
public fun borrow_mut_temp_state<S: drop, store>(stake: &mut object::Object<bbn::BBNStakeSeal>): &mut S

Function remove_temp_state

#[private_generics(#[S])]
public fun remove_temp_state<S: drop, store>(stake: &mut object::Object<bbn::BBNStakeSeal>): S

Function block_height

public fun block_height(stake: &bbn::BBNStakeSeal): u64

Function txid

public fun txid(stake: &bbn::BBNStakeSeal): address

Function staking_output_index

public fun staking_output_index(stake: &bbn::BBNStakeSeal): u32

Function outpoint

Function tag

public fun tag(stake: &bbn::BBNStakeSeal): &vector<u8>

Function staker_pub_key

public fun staker_pub_key(stake: &bbn::BBNStakeSeal): &vector<u8>

Function finality_provider_pub_key

Function staking_time

public fun staking_time(stake: &bbn::BBNStakeSeal): u16

Function staking_value

public fun staking_value(stake: &bbn::BBNStakeSeal): u64

Function is_expired

Deprecated function Use bbn_updater::is_expired instead

public fun is_expired(_stake: &bbn::BBNStakeSeal): bool

Function is_expired_at

public fun is_expired_at(stake: &bbn::BBNStakeSeal, current_block_height: u64): bool