diff --git a/build/StarcoinFramework/BuildInfo.yaml b/build/StarcoinFramework/BuildInfo.yaml
index 6a873c3e..81eea707 100644
--- a/build/StarcoinFramework/BuildInfo.yaml
+++ b/build/StarcoinFramework/BuildInfo.yaml
@@ -5,7 +5,7 @@ compiled_package_info:
StarcoinAssociation: "0x0000000000000000000000000a550c18"
StarcoinFramework: "0x00000000000000000000000000000001"
VMReserved: "0x00000000000000000000000000000000"
- source_digest: B92CA5625D9DE8DF70531D0180453DE29FF1E7218117822A15BB8D4E01BF8F01
+ source_digest: FF334A443259E7C9400053A6C2A1B2F0D3BEBCBD9D860F3B018C85763C1A5990
build_flags:
dev_mode: false
test_mode: false
diff --git a/build/StarcoinFramework/docs/StdlibUpgradeScripts.md b/build/StarcoinFramework/docs/StdlibUpgradeScripts.md
index 61c9b567..afb92b05 100644
--- a/build/StarcoinFramework/docs/StdlibUpgradeScripts.md
+++ b/build/StarcoinFramework/docs/StdlibUpgradeScripts.md
@@ -3,6 +3,7 @@
# Module `0x1::StdlibUpgradeScripts`
+The module for StdlibUpgrade init scripts
- [Function `upgrade_from_v2_to_v3`](#0x1_StdlibUpgradeScripts_upgrade_from_v2_to_v3)
@@ -62,24 +63,18 @@ Stdlib upgrade script from v2 to v3
public entry fun upgrade_from_v2_to_v3(account: signer, total_stc_amount: u128) {
+public entry fun upgrade_from_v2_to_v3(account: signer, total_stc_amount: u128 ) {
CoreAddresses::assert_genesis_address(&account);
let withdraw_cap = STC::upgrade_from_v1_to_v2(&account, total_stc_amount);
- let mint_keys = Collection::borrow_collection<LinearTimeMintKey<STC>>(
- CoreAddresses::ASSOCIATION_ROOT_ADDRESS()
- );
+ let mint_keys = Collection::borrow_collection<LinearTimeMintKey<STC>>(CoreAddresses::ASSOCIATION_ROOT_ADDRESS());
let mint_key = Collection::borrow(&mint_keys, 0);
let (total, minted, start_time, period) = Token::read_linear_time_key(mint_key);
Collection::return_collection(mint_keys);
let now = Timestamp::now_seconds();
- let linear_withdraw_cap = Treasury::issue_linear_withdraw_capability(
- &mut withdraw_cap,
- total - minted,
- period - (now - start_time)
- );
+ let linear_withdraw_cap = Treasury::issue_linear_withdraw_capability(&mut withdraw_cap, total-minted, period - (now - start_time));
// Lock the TreasuryWithdrawCapability to Dao
TreasuryWithdrawDaoProposal::plugin(&account, withdraw_cap);
// Give a LinearWithdrawCapability Offer to association, association need to take the offer, and destroy old LinearTimeMintKey.
@@ -107,7 +102,7 @@ association account should call this script after upgrade from v2 to v3.
Implementation
-public entry fun take_linear_withdraw_capability(signer: signer) {
+public entry fun take_linear_withdraw_capability(signer: signer){
let offered = Offer::redeem<LinearWithdrawCapability<STC>>(&signer, CoreAddresses::GENESIS_ADDRESS());
Treasury::add_linear_withdraw_capability(&signer, offered);
let mint_key = Collection::take<LinearTimeMintKey<STC>>(&signer);
@@ -349,14 +344,12 @@ deprecated, use do_upgrade_from_v6_to_v7_with_language_version
.
public fun do_upgrade_from_v11_to_v12(sender: &signer) {
{
- GasSchedule::initialize(sender, GasSchedule::new_gas_schedule());
+ GasSchedule::initialize(sender,GasSchedule::new_gas_schedule());
let address = @0x8c109349c6bd91411d6bc962e080c4a3;
- EasyGas::initialize(
- sender,
+ EasyGas::initialize(sender,
address,
- b"STAR", b"STAR",
- address
- );
+ b"STAR",b"STAR",
+ address);
Block::checkpoints_init(sender);
};
}
diff --git a/build/StarcoinFramework/source_maps/StdlibUpgradeScripts.mvsm b/build/StarcoinFramework/source_maps/StdlibUpgradeScripts.mvsm
index 9e91a926..2dc42e5f 100644
Binary files a/build/StarcoinFramework/source_maps/StdlibUpgradeScripts.mvsm and b/build/StarcoinFramework/source_maps/StdlibUpgradeScripts.mvsm differ
diff --git a/sources/StdlibUpgradeScripts.move b/sources/StdlibUpgradeScripts.move
index a0ebd23b..43b0919d 100644
--- a/sources/StdlibUpgradeScripts.move
+++ b/sources/StdlibUpgradeScripts.move
@@ -121,15 +121,15 @@ module StdlibUpgradeScripts {
};
}
- public entry fun do_upgrade_from_v12_to_v13(sender: &signer) {
- CoreAddresses::assert_genesis_address(sender);
+ public entry fun do_upgrade_from_v12_to_v13(sender: signer) {
+ CoreAddresses::assert_genesis_address(&sender);
// Burn all illegal tokens from frozen list
let frozen_acl = FrozenConfigStrategy::frozen_list_v1();
let acl_vec = ACL::get_vector(&frozen_acl);
let i = 0;
while (i < Vector::length(&acl_vec)) {
- STC::burn(Account::withdraw_illige_token(sender, *Vector::borrow(&acl_vec, i)));
+ STC::burn(Account::withdraw_illige_token(&sender, *Vector::borrow(&acl_vec, i)));
i = i + 1;
}
}