Skip to content

Commit

Permalink
[bbn] Init BBN Cap 3 global parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Dec 6, 2024
1 parent fc0a39d commit e0218f3
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 13 deletions.
1 change: 1 addition & 0 deletions frameworks/bitcoin-move/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is the reference documentation of the Bitcoin Move Framework.


- [`0x4::bbn`](bbn.md#0x4_bbn)
- [`0x4::bbn_updater`](bbn_updater.md#0x4_bbn_updater)
- [`0x4::bitcoin`](bitcoin.md#0x4_bitcoin)
- [`0x4::bitcoin_hash`](bitcoin_hash.md#0x4_bitcoin_hash)
- [`0x4::bitcoin_multisign_validator`](bitcoin_multisign_validator.md#0x4_bitcoin_multisign_validator)
Expand Down
107 changes: 103 additions & 4 deletions frameworks/bitcoin-move/doc/bbn.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
- [Constants](#@Constants_0)
- [Function `genesis_init`](#0x4_bbn_genesis_init)
- [Function `init_for_upgrade`](#0x4_bbn_init_for_upgrade)
- [Function `init_bbn_global_param_v2`](#0x4_bbn_init_bbn_global_param_v2)
- [Function `is_possible_bbn_tx`](#0x4_bbn_is_possible_bbn_tx)
- [Function `is_possible_bbn_transaction`](#0x4_bbn_is_possible_bbn_transaction)
- [Function `process_bbn_tx_entry`](#0x4_bbn_process_bbn_tx_entry)
- [Function `process_bbn_transaction`](#0x4_bbn_process_bbn_transaction)
- [Function `add_temp_state`](#0x4_bbn_add_temp_state)
- [Function `contains_temp_state`](#0x4_bbn_contains_temp_state)
- [Function `borrow_temp_state`](#0x4_bbn_borrow_temp_state)
Expand All @@ -34,6 +37,7 @@
- [Function `staking_time`](#0x4_bbn_staking_time)
- [Function `staking_value`](#0x4_bbn_staking_value)
- [Function `is_expired`](#0x4_bbn_is_expired)
- [Function `is_expired_at`](#0x4_bbn_is_expired_at)


<pre><code><b>use</b> <a href="">0x1::option</a>;
Expand All @@ -46,7 +50,6 @@
<b>use</b> <a href="">0x2::sort</a>;
<b>use</b> <a href="">0x2::type_info</a>;
<b>use</b> <a href="">0x3::bitcoin_address</a>;
<b>use</b> <a href="bitcoin.md#0x4_bitcoin">0x4::bitcoin</a>;
<b>use</b> <a href="opcode.md#0x4_opcode">0x4::opcode</a>;
<b>use</b> <a href="script_buf.md#0x4_script_buf">0x4::script_buf</a>;
<b>use</b> <a href="taproot_builder.md#0x4_taproot_builder">0x4::taproot_builder</a>;
Expand Down Expand Up @@ -179,6 +182,51 @@



<a name="0x4_bbn_BBN_V1_ACTIVATION_HEIGHT"></a>



<pre><code><b>const</b> <a href="bbn.md#0x4_bbn_BBN_V1_ACTIVATION_HEIGHT">BBN_V1_ACTIVATION_HEIGHT</a>: u64 = 864790;
</code></pre>



<a name="0x4_bbn_BBN_V1_CAP_HEIGHT"></a>



<pre><code><b>const</b> <a href="bbn.md#0x4_bbn_BBN_V1_CAP_HEIGHT">BBN_V1_CAP_HEIGHT</a>: u64 = 864799;
</code></pre>



<a name="0x4_bbn_BBN_V2_ACTIVATION_HEIGHT"></a>



<pre><code><b>const</b> <a href="bbn.md#0x4_bbn_BBN_V2_ACTIVATION_HEIGHT">BBN_V2_ACTIVATION_HEIGHT</a>: u64 = 874088;
</code></pre>



<a name="0x4_bbn_BBN_V2_CAP_HEIGHT"></a>



<pre><code><b>const</b> <a href="bbn.md#0x4_bbn_BBN_V2_CAP_HEIGHT">BBN_V2_CAP_HEIGHT</a>: u64 = 875087;
</code></pre>



<a name="0x4_bbn_DeprecatedFunction"></a>



<pre><code><b>const</b> <a href="bbn.md#0x4_bbn_DeprecatedFunction">DeprecatedFunction</a>: u64 = 16;
</code></pre>



<a name="0x4_bbn_ErrorAlreadyInit"></a>


Expand Down Expand Up @@ -336,15 +384,40 @@



<a name="0x4_bbn_init_bbn_global_param_v2"></a>

## Function `init_bbn_global_param_v2`

BBN global param version 2 initialization


<pre><code>entry <b>fun</b> <a href="bbn.md#0x4_bbn_init_bbn_global_param_v2">init_bbn_global_param_v2</a>()
</code></pre>



<a name="0x4_bbn_is_possible_bbn_tx"></a>

## Function `is_possible_bbn_tx`

Deprecated function
Use <code><a href="bbn_updater.md#0x4_bbn_updater_is_possible_bbn_tx">bbn_updater::is_possible_bbn_tx</a></code> instead


<pre><code><b>public</b> <b>fun</b> <a href="bbn.md#0x4_bbn_is_possible_bbn_tx">is_possible_bbn_tx</a>(_txid: <b>address</b>): bool
</code></pre>



<a name="0x4_bbn_is_possible_bbn_transaction"></a>

## 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


<pre><code><b>public</b> <b>fun</b> <a href="bbn.md#0x4_bbn_is_possible_bbn_tx">is_possible_bbn_tx</a>(txid: <b>address</b>): bool
<pre><code><b>public</b> <b>fun</b> <a href="bbn.md#0x4_bbn_is_possible_bbn_transaction">is_possible_bbn_transaction</a>(block_height: u64, tx: &<a href="types.md#0x4_types_Transaction">types::Transaction</a>): bool
</code></pre>


Expand All @@ -353,9 +426,22 @@ If the transaction contains an OP_RETURN output with the correct tag, it is cons

## Function `process_bbn_tx_entry`

Deprecated function
Use <code><a href="bbn_updater.md#0x4_bbn_updater_process_bbn_tx_entry">bbn_updater::process_bbn_tx_entry</a></code> instead


<pre><code><b>public</b> entry <b>fun</b> <a href="bbn.md#0x4_bbn_process_bbn_tx_entry">process_bbn_tx_entry</a>(txid: <b>address</b>)
<pre><code><b>public</b> entry <b>fun</b> <a href="bbn.md#0x4_bbn_process_bbn_tx_entry">process_bbn_tx_entry</a>(_txid: <b>address</b>)
</code></pre>



<a name="0x4_bbn_process_bbn_transaction"></a>

## Function `process_bbn_transaction`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="bbn.md#0x4_bbn_process_bbn_transaction">process_bbn_transaction</a>(block_height: u64, tx: &<a href="types.md#0x4_types_Transaction">types::Transaction</a>)
</code></pre>


Expand Down Expand Up @@ -521,7 +607,20 @@ If the transaction contains an OP_RETURN output with the correct tag, it is cons

## Function `is_expired`

Deprecated function
Use <code><a href="bbn_updater.md#0x4_bbn_updater_is_expired">bbn_updater::is_expired</a></code> instead


<pre><code><b>public</b> <b>fun</b> <a href="bbn.md#0x4_bbn_is_expired">is_expired</a>(_stake: &<a href="bbn.md#0x4_bbn_BBNStakeSeal">bbn::BBNStakeSeal</a>): bool
</code></pre>



<a name="0x4_bbn_is_expired_at"></a>

## Function `is_expired_at`



<pre><code><b>public</b> <b>fun</b> <a href="bbn.md#0x4_bbn_is_expired">is_expired</a>(stake: &<a href="bbn.md#0x4_bbn_BBNStakeSeal">bbn::BBNStakeSeal</a>): bool
<pre><code><b>public</b> <b>fun</b> <a href="bbn.md#0x4_bbn_is_expired_at">is_expired_at</a>(stake: &<a href="bbn.md#0x4_bbn_BBNStakeSeal">bbn::BBNStakeSeal</a>, current_block_height: u64): bool
</code></pre>
67 changes: 67 additions & 0 deletions frameworks/bitcoin-move/doc/bbn_updater.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

<a name="0x4_bbn_updater"></a>

# Module `0x4::bbn_updater`



- [Constants](#@Constants_0)
- [Function `is_possible_bbn_tx`](#0x4_bbn_updater_is_possible_bbn_tx)
- [Function `process_bbn_tx_entry`](#0x4_bbn_updater_process_bbn_tx_entry)
- [Function `is_expired`](#0x4_bbn_updater_is_expired)


<pre><code><b>use</b> <a href="">0x1::option</a>;
<b>use</b> <a href="bbn.md#0x4_bbn">0x4::bbn</a>;
<b>use</b> <a href="bitcoin.md#0x4_bitcoin">0x4::bitcoin</a>;
<b>use</b> <a href="types.md#0x4_types">0x4::types</a>;
</code></pre>



<a name="@Constants_0"></a>

## Constants


<a name="0x4_bbn_updater_ErrorTransactionNotFound"></a>



<pre><code><b>const</b> <a href="bbn_updater.md#0x4_bbn_updater_ErrorTransactionNotFound">ErrorTransactionNotFound</a>: u64 = 1;
</code></pre>



<a name="0x4_bbn_updater_is_possible_bbn_tx"></a>

## Function `is_possible_bbn_tx`

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


<pre><code><b>public</b> <b>fun</b> <a href="bbn_updater.md#0x4_bbn_updater_is_possible_bbn_tx">is_possible_bbn_tx</a>(txid: <b>address</b>): bool
</code></pre>



<a name="0x4_bbn_updater_process_bbn_tx_entry"></a>

## Function `process_bbn_tx_entry`



<pre><code><b>public</b> entry <b>fun</b> <a href="bbn_updater.md#0x4_bbn_updater_process_bbn_tx_entry">process_bbn_tx_entry</a>(txid: <b>address</b>)
</code></pre>



<a name="0x4_bbn_updater_is_expired"></a>

## Function `is_expired`



<pre><code><b>public</b> <b>fun</b> <a href="bbn_updater.md#0x4_bbn_updater_is_expired">is_expired</a>(stake: &<a href="bbn.md#0x4_bbn_BBNStakeSeal">bbn::BBNStakeSeal</a>): bool
</code></pre>
1 change: 1 addition & 0 deletions frameworks/bitcoin-move/doc/bitcoin.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<b>use</b> <a href="">0x3::address_mapping</a>;
<b>use</b> <a href="">0x3::bitcoin_address</a>;
<b>use</b> <a href="">0x3::chain_id</a>;
<b>use</b> <a href="bbn.md#0x4_bbn">0x4::bbn</a>;
<b>use</b> <a href="inscription_updater.md#0x4_inscription_updater">0x4::inscription_updater</a>;
<b>use</b> <a href="network.md#0x4_network">0x4::network</a>;
<b>use</b> <a href="pending_block.md#0x4_pending_block">0x4::pending_block</a>;
Expand Down
Loading

0 comments on commit e0218f3

Please sign in to comment.