- Struct
BBNGlobalParamV0
- Struct
BBNGlobalParamV1
- Resource
BBNGlobalParams
- Struct
BBNOpReturnOutput
- Struct
BBNV0OpReturnData
- Resource
BBNStakeSeal
- Struct
BBNScriptPaths
- Struct
BBNStakingEvent
- Struct
BBNStakingFailedEvent
- Struct
BBNStakingUnbondingEvent
- Struct
TempStateDropEvent
- Constants
- Function
genesis_init
- Function
init_for_upgrade
- Function
init_bbn_global_param_v2
- Function
is_possible_bbn_tx
- Function
is_possible_bbn_transaction
- Function
process_bbn_tx_entry
- Function
process_bbn_transaction
- Function
on_utxo_spend
- Function
remove_bbn_seal
- Function
add_temp_state
- Function
contains_temp_state
- Function
borrow_temp_state
- Function
borrow_mut_temp_state
- Function
remove_temp_state
- Function
block_height
- Function
txid
- Function
staking_output_index
- Function
outpoint
- Function
tag
- Function
staker_pub_key
- Function
finality_provider_pub_key
- Function
staking_time
- Function
staking_value
- Function
is_expired
- Function
is_expired_at
use 0x1::option;
use 0x1::string;
use 0x1::vector;
use 0x2::bcs;
use 0x2::event;
use 0x2::event_queue;
use 0x2::object;
use 0x2::result;
use 0x2::sort;
use 0x2::type_info;
use 0x3::bitcoin_address;
use 0x4::opcode;
use 0x4::script_buf;
use 0x4::taproot_builder;
use 0x4::temp_state;
use 0x4::types;
use 0x4::utxo;
struct BBNGlobalParamV0 has copy, drop, store
struct BBNGlobalParamV1 has copy, drop, store
struct BBNGlobalParams has key
struct BBNOpReturnOutput has copy, drop, store
struct BBNV0OpReturnData has copy, drop, store
struct BBNStakeSeal has key
struct BBNScriptPaths has copy, drop, store
struct BBNStakingEvent has copy, drop, store
struct BBNStakingFailedEvent has copy, drop, store
struct BBNStakingUnbondingEvent has copy, drop, store
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
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 ErrorFailedToFinalizeTaproot: u64 = 12;
const ErrorInvalidBabylonOpReturn: u64 = 5;
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];
public(friend) fun genesis_init()
public fun init_for_upgrade()
BBN global param version 2 initialization
entry fun init_bbn_global_param_v2()
Deprecated function
Use bbn_updater::is_possible_bbn_tx
instead
public fun is_possible_bbn_tx(_txid: address): bool
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
Deprecated function
Use bbn_updater::process_bbn_tx_entry
instead
public entry fun process_bbn_tx_entry(_txid: address)
public(friend) fun process_bbn_transaction(block_height: u64, tx: &types::Transaction)
public(friend) fun on_utxo_spend(utxo: &mut utxo::UTXO)
public(friend) fun remove_bbn_seal(seal_obj_id: object::ObjectID)
#[private_generics(#[S])]
public fun add_temp_state<S: drop, store>(stake: &mut object::Object<bbn::BBNStakeSeal>, state: S)
public fun contains_temp_state<S: drop, store>(stake: &object::Object<bbn::BBNStakeSeal>): bool
public fun borrow_temp_state<S: drop, store>(stake: &object::Object<bbn::BBNStakeSeal>): &S
#[private_generics(#[S])]
public fun borrow_mut_temp_state<S: drop, store>(stake: &mut object::Object<bbn::BBNStakeSeal>): &mut S
#[private_generics(#[S])]
public fun remove_temp_state<S: drop, store>(stake: &mut object::Object<bbn::BBNStakeSeal>): S
public fun block_height(stake: &bbn::BBNStakeSeal): u64
public fun txid(stake: &bbn::BBNStakeSeal): address
public fun staking_output_index(stake: &bbn::BBNStakeSeal): u32
public fun outpoint(stake: &bbn::BBNStakeSeal): types::OutPoint
public fun tag(stake: &bbn::BBNStakeSeal): &vector<u8>
public fun staker_pub_key(stake: &bbn::BBNStakeSeal): &vector<u8>
public fun finality_provider_pub_key(stake: &bbn::BBNStakeSeal): &vector<u8>
public fun staking_time(stake: &bbn::BBNStakeSeal): u16
public fun staking_value(stake: &bbn::BBNStakeSeal): u64
Deprecated function
Use bbn_updater::is_expired
instead
public fun is_expired(_stake: &bbn::BBNStakeSeal): bool
public fun is_expired_at(stake: &bbn::BBNStakeSeal, current_block_height: u64): bool