Skip to content

Commit

Permalink
mirgate script functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pause125 committed Sep 22, 2022
1 parent 06f191c commit 68fcfef
Show file tree
Hide file tree
Showing 47 changed files with 491 additions and 43 deletions.
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: FC65276C4442A3E35469980B187C7C04C296FEB90A517E473F2E718CCFE8B4FB
source_digest: 5A6B8D51C23ACF7BB3B9754B1F485279609DD557E0591A325CEC3740BE8374D4
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file modified build/StarcoinFramework/bytecode_modules/Account.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/CheckpointScript.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/DummyTokenScripts.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/GenesisNFTScripts.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/IdentifierNFTScripts.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/NFTGalleryScripts.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/PackageTxnManager.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/PriceOracleScripts.mv
Binary file not shown.
138 changes: 120 additions & 18 deletions build/StarcoinFramework/docs/Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ The module for the account resource that governs every account
- [Function `make_account`](#0x1_Account_make_account)
- [Function `create_signer`](#0x1_Account_create_signer)
- [Function `create_account_with_initial_amount`](#0x1_Account_create_account_with_initial_amount)
- [Function `create_account_with_initial_amount_entry`](#0x1_Account_create_account_with_initial_amount_entry)
- [Function `create_account_with_initial_amount_v2`](#0x1_Account_create_account_with_initial_amount_v2)
- [Function `create_account_with_initial_amount_v2_entry`](#0x1_Account_create_account_with_initial_amount_v2_entry)
- [Function `create_delegate_account`](#0x1_Account_create_delegate_account)
- [Function `generate_fresh_address`](#0x1_Account_generate_fresh_address)
- [Function `deposit_to_self`](#0x1_Account_deposit_to_self)
Expand All @@ -58,10 +60,12 @@ The module for the account resource that governs every account
- [Function `restore_key_rotation_capability`](#0x1_Account_restore_key_rotation_capability)
- [Function `destroy_key_rotation_capability`](#0x1_Account_destroy_key_rotation_capability)
- [Function `rotate_authentication_key`](#0x1_Account_rotate_authentication_key)
- [Function `rotate_authentication_key_entry`](#0x1_Account_rotate_authentication_key_entry)
- [Function `balance_for`](#0x1_Account_balance_for)
- [Function `balance`](#0x1_Account_balance)
- [Function `do_accept_token`](#0x1_Account_do_accept_token)
- [Function `accept_token`](#0x1_Account_accept_token)
- [Function `accept_token_entry`](#0x1_Account_accept_token_entry)
- [Function `is_accepts_token`](#0x1_Account_is_accepts_token)
- [Function `is_accept_token`](#0x1_Account_is_accept_token)
- [Function `can_auto_accept_token`](#0x1_Account_can_auto_accept_token)
Expand Down Expand Up @@ -1228,7 +1232,7 @@ reserved address for the MoveVM.

<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_create_account_with_initial_amount">create_account_with_initial_amount</a>&lt;TokenType: store&gt;(account: signer, fresh_address: <b>address</b>, _auth_key: vector&lt;u8&gt;, initial_amount: u128)
<b>acquires</b> <a href="Account.md#0x1_Account">Account</a>, <a href="Account.md#0x1_Account_Balance">Balance</a>, <a href="Account.md#0x1_Account_AutoAcceptToken">AutoAcceptToken</a> {
<a href="Account.md#0x1_Account_create_account_with_initial_amount_v2">create_account_with_initial_amount_v2</a>&lt;TokenType&gt;(account, fresh_address, initial_amount)
<a href="Account.md#0x1_Account_create_account_with_initial_amount_entry">create_account_with_initial_amount_entry</a>&lt;TokenType&gt;(account, fresh_address, _auth_key, initial_amount);
}
</code></pre>

Expand All @@ -1246,6 +1250,31 @@ reserved address for the MoveVM.



</details>

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

## Function `create_account_with_initial_amount_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_create_account_with_initial_amount_entry">create_account_with_initial_amount_entry</a>&lt;TokenType: store&gt;(account: signer, fresh_address: <b>address</b>, _auth_key: vector&lt;u8&gt;, initial_amount: u128)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_create_account_with_initial_amount_entry">create_account_with_initial_amount_entry</a>&lt;TokenType: store&gt;(account: signer, fresh_address: <b>address</b>, _auth_key: vector&lt;u8&gt;, initial_amount: u128)
<b>acquires</b> <a href="Account.md#0x1_Account">Account</a>, <a href="Account.md#0x1_Account_Balance">Balance</a>, <a href="Account.md#0x1_Account_AutoAcceptToken">AutoAcceptToken</a> {
<a href="Account.md#0x1_Account_create_account_with_initial_amount_v2">create_account_with_initial_amount_v2</a>&lt;TokenType&gt;(account, fresh_address, initial_amount)
}
</code></pre>



</details>

<a name="0x1_Account_create_account_with_initial_amount_v2"></a>
Expand All @@ -1265,10 +1294,7 @@ reserved address for the MoveVM.

<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_create_account_with_initial_amount_v2">create_account_with_initial_amount_v2</a>&lt;TokenType: store&gt;(account: signer, fresh_address: <b>address</b>, initial_amount: u128)
<b>acquires</b> <a href="Account.md#0x1_Account">Account</a>, <a href="Account.md#0x1_Account_Balance">Balance</a>, <a href="Account.md#0x1_Account_AutoAcceptToken">AutoAcceptToken</a> {
<a href="Account.md#0x1_Account_create_account_with_address">create_account_with_address</a>&lt;TokenType&gt;(fresh_address);
<b>if</b> (initial_amount &gt; 0) {
<a href="Account.md#0x1_Account_pay_from">pay_from</a>&lt;TokenType&gt;(&account, fresh_address, initial_amount);
};
<a href="Account.md#0x1_Account_create_account_with_initial_amount_v2_entry">create_account_with_initial_amount_v2_entry</a>&lt;TokenType&gt;(account, fresh_address, initial_amount);
}
</code></pre>

Expand All @@ -1286,6 +1312,34 @@ reserved address for the MoveVM.



</details>

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

## Function `create_account_with_initial_amount_v2_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_create_account_with_initial_amount_v2_entry">create_account_with_initial_amount_v2_entry</a>&lt;TokenType: store&gt;(account: signer, fresh_address: <b>address</b>, initial_amount: u128)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_create_account_with_initial_amount_v2_entry">create_account_with_initial_amount_v2_entry</a>&lt;TokenType: store&gt;(account: signer, fresh_address: <b>address</b>, initial_amount: u128)
<b>acquires</b> <a href="Account.md#0x1_Account">Account</a>, <a href="Account.md#0x1_Account_Balance">Balance</a>, <a href="Account.md#0x1_Account_AutoAcceptToken">AutoAcceptToken</a> {
<a href="Account.md#0x1_Account_create_account_with_address">create_account_with_address</a>&lt;TokenType&gt;(fresh_address);
<b>if</b> (initial_amount &gt; 0) {
<a href="Account.md#0x1_Account_pay_from">pay_from</a>&lt;TokenType&gt;(&account, fresh_address, initial_amount);
};
}
</code></pre>



</details>

<a name="0x1_Account_create_delegate_account"></a>
Expand Down Expand Up @@ -2343,6 +2397,42 @@ Return the key rotation capability to the account it originally came from


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_rotate_authentication_key">rotate_authentication_key</a>(account: signer, new_key: vector&lt;u8&gt;) <b>acquires</b> <a href="Account.md#0x1_Account">Account</a>, <a href="Account.md#0x1_Account_EventStore">EventStore</a> {
<a href="Account.md#0x1_Account_rotate_authentication_key_entry">rotate_authentication_key_entry</a>(account, new_key);
}
</code></pre>



</details>

<details>
<summary>Specification</summary>



<pre><code><b>pragma</b> verify = <b>false</b>;
</code></pre>



</details>

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

## Function `rotate_authentication_key_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_rotate_authentication_key_entry">rotate_authentication_key_entry</a>(account: signer, new_key: vector&lt;u8&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_rotate_authentication_key_entry">rotate_authentication_key_entry</a>(account: signer, new_key: vector&lt;u8&gt;) <b>acquires</b> <a href="Account.md#0x1_Account">Account</a>, <a href="Account.md#0x1_Account_EventStore">EventStore</a> {
<b>let</b> key_rotation_capability = <a href="Account.md#0x1_Account_extract_key_rotation_capability">extract_key_rotation_capability</a>(&account);
<a href="Account.md#0x1_Account_rotate_authentication_key_with_capability">rotate_authentication_key_with_capability</a>(&key_rotation_capability, <b>copy</b> new_key);
<a href="Account.md#0x1_Account_restore_key_rotation_capability">restore_key_rotation_capability</a>(key_rotation_capability);
Expand All @@ -2362,18 +2452,6 @@ Return the key rotation capability to the account it originally came from



</details>

<details>
<summary>Specification</summary>



<pre><code><b>pragma</b> verify = <b>false</b>;
</code></pre>



</details>

<a name="0x1_Account_balance_for"></a>
Expand Down Expand Up @@ -2506,7 +2584,7 @@ Add a balance of <code><a href="Token.md#0x1_Token">Token</a></code> type to the


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_accept_token">accept_token</a>&lt;TokenType: store&gt;(account: signer) <b>acquires</b> <a href="Account.md#0x1_Account">Account</a> {
<a href="Account.md#0x1_Account_do_accept_token">do_accept_token</a>&lt;TokenType&gt;(&account);
<a href="Account.md#0x1_Account_accept_token_entry">accept_token_entry</a>&lt;TokenType&gt;(account);
}
</code></pre>

Expand All @@ -2524,6 +2602,30 @@ Add a balance of <code><a href="Token.md#0x1_Token">Token</a></code> type to the



</details>

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

## Function `accept_token_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_accept_token_entry">accept_token_entry</a>&lt;TokenType: store&gt;(account: signer)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Account.md#0x1_Account_accept_token_entry">accept_token_entry</a>&lt;TokenType: store&gt;(account: signer) <b>acquires</b> <a href="Account.md#0x1_Account">Account</a> {
<a href="Account.md#0x1_Account_do_accept_token">do_accept_token</a>&lt;TokenType&gt;(&account);
}
</code></pre>



</details>

<a name="0x1_Account_is_accepts_token"></a>
Expand Down
54 changes: 52 additions & 2 deletions build/StarcoinFramework/docs/Block.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@


- [Function `checkpoint`](#0x1_CheckpointScript_checkpoint)
- [Function `checkpoint_entry`](#0x1_CheckpointScript_checkpoint_entry)
- [Function `update_state_root`](#0x1_CheckpointScript_update_state_root)
- [Function `update_state_root_entry`](#0x1_CheckpointScript_update_state_root_entry)


<pre><code><b>use</b> <a href="Block.md#0x1_Block">0x1::Block</a>;
Expand All @@ -30,7 +32,7 @@


<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="Block.md#0x1_CheckpointScript_checkpoint">checkpoint</a>(_account: signer){
<a href="Block.md#0x1_Block_checkpoint">Block::checkpoint</a>();
<a href="Block.md#0x1_CheckpointScript_checkpoint_entry">checkpoint_entry</a>(_account);
}
</code></pre>

Expand All @@ -48,6 +50,30 @@



</details>

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

## Function `checkpoint_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Block.md#0x1_CheckpointScript_checkpoint_entry">checkpoint_entry</a>(_account: signer)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="Block.md#0x1_CheckpointScript_checkpoint_entry">checkpoint_entry</a>(_account: signer){
<a href="Block.md#0x1_Block_checkpoint">Block::checkpoint</a>();
}
</code></pre>



</details>

<a name="0x1_CheckpointScript_update_state_root"></a>
Expand All @@ -66,7 +92,7 @@


<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="Block.md#0x1_CheckpointScript_update_state_root">update_state_root</a>(_account: signer , header: vector&lt;u8&gt;){
<a href="Block.md#0x1_Block_update_state_root">Block::update_state_root</a>(header);
<a href="Block.md#0x1_CheckpointScript_update_state_root_entry">update_state_root_entry</a>(_account , header);
}
</code></pre>

Expand All @@ -84,4 +110,28 @@



</details>

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

## Function `update_state_root_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="Block.md#0x1_CheckpointScript_update_state_root_entry">update_state_root_entry</a>(_account: signer, header: vector&lt;u8&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>script</b>) <b>fun</b> <a href="Block.md#0x1_CheckpointScript_update_state_root_entry">update_state_root_entry</a>(_account: signer , header: vector&lt;u8&gt;){
<a href="Block.md#0x1_Block_update_state_root">Block::update_state_root</a>(header);
}
</code></pre>



</details>
25 changes: 25 additions & 0 deletions build/StarcoinFramework/docs/DummyToken.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


- [Function `mint`](#0x1_DummyTokenScripts_mint)
- [Function `mint_entry`](#0x1_DummyTokenScripts_mint_entry)


<pre><code><b>use</b> <a href="Account.md#0x1_Account">0x1::Account</a>;
Expand All @@ -32,6 +33,30 @@


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="DummyToken.md#0x1_DummyTokenScripts_mint">mint</a>(sender: signer, amount: u128){
<a href="DummyToken.md#0x1_DummyTokenScripts_mint_entry">mint_entry</a>(sender, amount);
}
</code></pre>



</details>

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

## Function `mint_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="DummyToken.md#0x1_DummyTokenScripts_mint_entry">mint_entry</a>(sender: signer, amount: u128)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="DummyToken.md#0x1_DummyTokenScripts_mint_entry">mint_entry</a>(sender: signer, amount: u128){
<b>let</b> token = <a href="DummyToken.md#0x1_DummyToken_mint">DummyToken::mint</a>(&sender, amount);
<b>let</b> sender_addr = <a href="Signer.md#0x1_Signer_address_of">Signer::address_of</a>(&sender);
<b>if</b>(<a href="Account.md#0x1_Account_is_accept_token">Account::is_accept_token</a>&lt;<a href="DummyToken.md#0x1_DummyToken">DummyToken</a>&gt;(sender_addr)){
Expand Down
25 changes: 25 additions & 0 deletions build/StarcoinFramework/docs/GenesisNFT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


- [Function `mint`](#0x1_GenesisNFTScripts_mint)
- [Function `mint_entry`](#0x1_GenesisNFTScripts_mint_entry)
- [Module Specification](#@Module_Specification_0)


Expand All @@ -31,6 +32,30 @@ Mint a GenesisNFT


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="GenesisNFT.md#0x1_GenesisNFTScripts_mint">mint</a>(sender: signer, index: u64, merkle_proof:vector&lt;vector&lt;u8&gt;&gt;) {
<a href="GenesisNFT.md#0x1_GenesisNFTScripts_mint_entry">mint_entry</a>(sender, index, merkle_proof);
}
</code></pre>



</details>

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

## Function `mint_entry`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="GenesisNFT.md#0x1_GenesisNFTScripts_mint_entry">mint_entry</a>(sender: signer, index: u64, merkle_proof: vector&lt;vector&lt;u8&gt;&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="GenesisNFT.md#0x1_GenesisNFTScripts_mint_entry">mint_entry</a>(sender: signer, index: u64, merkle_proof:vector&lt;vector&lt;u8&gt;&gt;) {
<a href="GenesisNFT.md#0x1_GenesisNFT_mint">GenesisNFT::mint</a>(&sender, index, merkle_proof);
}
</code></pre>
Expand Down
Loading

0 comments on commit 68fcfef

Please sign in to comment.