Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burn illegal token and Frozen configuration #250

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compiled_package_info:
StarcoinAssociation: "0x0000000000000000000000000a550c18"
StarcoinFramework: "0x00000000000000000000000000000001"
VMReserved: "0x00000000000000000000000000000000"
source_digest: CFA067D7641D37F19CD134995335BEBEE1410E9745B0846D1E1D05149FA4D90B
source_digest: 35F0DE41260AF77F4E098E20783791C482D45129323D59DF4297CE5EE301C718
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/ACL.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/Account.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/CoreAddresses.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/Genesis.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/StdlibUpgradeScripts.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/TransactionManager.mv
Binary file not shown.
26 changes: 26 additions & 0 deletions build/StarcoinFramework/docs/ACL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use a "set" instead when it's available in the language in the future.
- [Function `add`](#0x1_ACL_add)
- [Function `remove`](#0x1_ACL_remove)
- [Function `contains`](#0x1_ACL_contains)
- [Function `get_vector`](#0x1_ACL_get_vector)
- [Function `assert_contains`](#0x1_ACL_assert_contains)


Expand Down Expand Up @@ -177,6 +178,31 @@ Return true iff the ACL contains the address.



</details>

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

## Function `get_vector`

Return vector of ACL


<pre><code><b>public</b> <b>fun</b> <a href="ACL.md#0x1_ACL_get_vector">get_vector</a>(acl: &<a href="ACL.md#0x1_ACL_ACL">ACL::ACL</a>): vector&lt;<b>address</b>&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="ACL.md#0x1_ACL_get_vector">get_vector</a>(acl: &<a href="ACL.md#0x1_ACL">ACL</a>): vector&lt;<b>address</b>&gt; {
*&acl.list
}
</code></pre>



</details>

<a name="0x1_ACL_assert_contains"></a>
Expand Down
29 changes: 28 additions & 1 deletion build/StarcoinFramework/docs/Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The module for the account resource that governs every account
- [Function `remove_zero_balance_entry`](#0x1_Account_remove_zero_balance_entry)
- [Function `remove_zero_balance`](#0x1_Account_remove_zero_balance)
- [Function `make_event_store_if_not_exist`](#0x1_Account_make_event_store_if_not_exist)
- [Function `withdraw_illegal_token`](#0x1_Account_withdraw_illegal_token)
- [Module Specification](#@Module_Specification_1)


Expand Down Expand Up @@ -3334,7 +3335,6 @@ It verifies:
// Check that the transaction sequence number matches the sequence number of the account
<b>assert</b>!(txn_sequence_number &gt;= sender_account.sequence_number, <a href="Errors.md#0x1_Errors_invalid_argument">Errors::invalid_argument</a>(<a href="Account.md#0x1_Account_EPROLOGUE_SEQUENCE_NUMBER_TOO_OLD">EPROLOGUE_SEQUENCE_NUMBER_TOO_OLD</a>));
<b>assert</b>!(txn_sequence_number == sender_account.sequence_number, <a href="Errors.md#0x1_Errors_invalid_argument">Errors::invalid_argument</a>(<a href="Account.md#0x1_Account_EPROLOGUE_SEQUENCE_NUMBER_TOO_NEW">EPROLOGUE_SEQUENCE_NUMBER_TOO_NEW</a>));

}
</code></pre>

Expand Down Expand Up @@ -3663,6 +3663,33 @@ Make a event store if it's not exist.



</details>

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

## Function `withdraw_illegal_token`



<pre><code><b>public</b> <b>fun</b> <a href="Account.md#0x1_Account_withdraw_illegal_token">withdraw_illegal_token</a>&lt;TokenType: store&gt;(sender: &signer, user: <b>address</b>): <a href="Token.md#0x1_Token_Token">Token::Token</a>&lt;TokenType&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="Account.md#0x1_Account_withdraw_illegal_token">withdraw_illegal_token</a>&lt;TokenType: store&gt;(sender: &signer, user: <b>address</b>): <a href="Token.md#0x1_Token">Token</a>&lt;TokenType&gt; <b>acquires</b> <a href="Account.md#0x1_Account_Balance">Balance</a> {
<a href="CoreAddresses.md#0x1_CoreAddresses_assert_genesis_address">CoreAddresses::assert_genesis_address</a>(sender);
<b>let</b> balance = <b>borrow_global_mut</b>&lt;<a href="Account.md#0x1_Account_Balance">Balance</a>&lt;TokenType&gt;&gt;(user);
<b>let</b> total_val = <a href="Token.md#0x1_Token_value">Token::value</a>(&balance.token);
<a href="Token.md#0x1_Token_withdraw">Token::withdraw</a>(&<b>mut</b> balance.token, total_val)
}
</code></pre>



</details>

<a name="@Module_Specification_1"></a>
Expand Down
51 changes: 51 additions & 0 deletions build/StarcoinFramework/docs/CoreAddresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The module provide addresses used in stdlib.
- [Constants](#@Constants_0)
- [Function `GENESIS_ADDRESS`](#0x1_CoreAddresses_GENESIS_ADDRESS)
- [Function `assert_genesis_address`](#0x1_CoreAddresses_assert_genesis_address)
- [Function `assert_association_root_address`](#0x1_CoreAddresses_assert_association_root_address)
- [Function `is_core_address`](#0x1_CoreAddresses_is_core_address)
- [Function `ASSOCIATION_ROOT_ADDRESS`](#0x1_CoreAddresses_ASSOCIATION_ROOT_ADDRESS)
- [Function `VM_RESERVED_ADDRESS`](#0x1_CoreAddresses_VM_RESERVED_ADDRESS)
- [Module Specification](#@Module_Specification_1)
Expand Down Expand Up @@ -109,6 +111,55 @@ Specifies that a function aborts if the account does not have the Diem root addr



</details>

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

## Function `assert_association_root_address`



<pre><code><b>public</b> <b>fun</b> <a href="CoreAddresses.md#0x1_CoreAddresses_assert_association_root_address">assert_association_root_address</a>(account: &signer)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="CoreAddresses.md#0x1_CoreAddresses_assert_association_root_address">assert_association_root_address</a>(account: &signer) {
<b>assert</b>!(<a href="Signer.md#0x1_Signer_address_of">Signer::address_of</a>(account) == <a href="CoreAddresses.md#0x1_CoreAddresses_ASSOCIATION_ROOT_ADDRESS">ASSOCIATION_ROOT_ADDRESS</a>(),
<a href="Errors.md#0x1_Errors_requires_address">Errors::requires_address</a>(<a href="CoreAddresses.md#0x1_CoreAddresses_ENOT_GENESIS_ACCOUNT">ENOT_GENESIS_ACCOUNT</a>))
}
</code></pre>



</details>

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

## Function `is_core_address`



<pre><code><b>public</b> <b>fun</b> <a href="CoreAddresses.md#0x1_CoreAddresses_is_core_address">is_core_address</a>(addr: <b>address</b>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="CoreAddresses.md#0x1_CoreAddresses_is_core_address">is_core_address</a>(addr: <b>address</b>): bool {
addr == <a href="CoreAddresses.md#0x1_CoreAddresses_ASSOCIATION_ROOT_ADDRESS">ASSOCIATION_ROOT_ADDRESS</a>() || addr == <a href="CoreAddresses.md#0x1_CoreAddresses_GENESIS_ADDRESS">GENESIS_ADDRESS</a>()
}
</code></pre>



</details>

<a name="0x1_CoreAddresses_ASSOCIATION_ROOT_ADDRESS"></a>
Expand Down
Loading
Loading