Skip to content

Commit

Permalink
Revert "Add upgrade plugin And add StarcoinDAO (#94)"
Browse files Browse the repository at this point in the history
This reverts commit 85418d7.
  • Loading branch information
nkysg committed Mar 2, 2023
1 parent 10b1505 commit 44eda15
Show file tree
Hide file tree
Showing 39 changed files with 26 additions and 358 deletions.
8 changes: 1 addition & 7 deletions build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: StakeToSBTPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: StarcoinDAO
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: StarcoinVerifier
: StarcoinFramework
Expand Down Expand Up @@ -294,9 +291,6 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: UpgradeModuleDaoProposal
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: UpgradeModulePlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: VMConfig
: StarcoinFramework
Expand All @@ -312,7 +306,7 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: 5F36AADE9312D2934E215C4971621A24AF18EA5B56A52D2BE1D8E173174D0F3C
source_digest: A710EE5A9CB99AFE86615AD5840E39342DB78E8FB0F5F9509550D55526BF054D
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/Genesis.mv
Binary file not shown.
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/OnChainConfigDao.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/StdlibUpgradeScripts.mv
Binary file not shown.
Binary file not shown.
26 changes: 0 additions & 26 deletions build/StarcoinFramework/docs/Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ The module for the account resource that governs every account
- [Resource `EventStore`](#0x1_Account_EventStore)
- [Constants](#@Constants_0)
- [Function `remove_signer_capability`](#0x1_Account_remove_signer_capability)
- [Function `get_genesis_capability`](#0x1_Account_get_genesis_capability)
- [Function `create_signer_with_cap`](#0x1_Account_create_signer_with_cap)
- [Function `destroy_signer_cap`](#0x1_Account_destroy_signer_cap)
- [Function `signer_address`](#0x1_Account_signer_address)
Expand Down Expand Up @@ -831,31 +830,6 @@ This function can only called once by signer.



</details>

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

## Function `get_genesis_capability`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="Account.md#0x1_Account_get_genesis_capability">get_genesis_capability</a>(): <a href="Account.md#0x1_Account_SignerCapability">Account::SignerCapability</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>friend</b>) <b>fun</b> <a href="Account.md#0x1_Account_get_genesis_capability">get_genesis_capability</a>():<a href="Account.md#0x1_Account_SignerCapability">SignerCapability</a>{
<b>let</b> signer_cap = <a href="Account.md#0x1_Account_SignerCapability">SignerCapability</a> {addr: <a href="Token.md#0x1_Token_token_address">Token::token_address</a>&lt;<a href="STC.md#0x1_STC">STC</a>&gt;() };
signer_cap
}
</code></pre>



</details>

<a name="0x1_Account_create_signer_with_cap"></a>
Expand Down
1 change: 0 additions & 1 deletion build/StarcoinFramework/docs/Genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ The module for init Genesis

};
<a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_do_upgrade_from_v11_to_v12">StdlibUpgradeScripts::do_upgrade_from_v11_to_v12</a>();
<a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_do_upgrade_from_v12_to_v12_1">StdlibUpgradeScripts::do_upgrade_from_v12_to_v12_1</a>();
//Start time, <a href="Timestamp.md#0x1_Timestamp_is_genesis">Timestamp::is_genesis</a>() will <b>return</b> <b>false</b>. this call should at the end of genesis init.
<a href="Timestamp.md#0x1_Timestamp_set_time_has_started">Timestamp::set_time_has_started</a>(&genesis_account);
<a href="Account.md#0x1_Account_release_genesis_signer">Account::release_genesis_signer</a>(genesis_account);
Expand Down
27 changes: 0 additions & 27 deletions build/StarcoinFramework/docs/OnChainConfigDao.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ OnChainConfigDao is a DAO proposal for modify onchain configuration.
- [Function `plugin`](#0x1_OnChainConfigDao_plugin)
- [Function `propose_update`](#0x1_OnChainConfigDao_propose_update)
- [Function `execute`](#0x1_OnChainConfigDao_execute)
- [Function `config_cap`](#0x1_OnChainConfigDao_config_cap)
- [Module Specification](#@Module_Specification_1)


<pre><code><b>use</b> <a href="Config.md#0x1_Config">0x1::Config</a>;
<b>use</b> <a href="CoreAddresses.md#0x1_CoreAddresses">0x1::CoreAddresses</a>;
<b>use</b> <a href="Dao.md#0x1_Dao">0x1::Dao</a>;
<b>use</b> <a href="Errors.md#0x1_Errors">0x1::Errors</a>;
<b>use</b> <a href="Signer.md#0x1_Signer">0x1::Signer</a>;
Expand Down Expand Up @@ -245,31 +243,6 @@ the kind of this proposal module.



</details>

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

## Function `config_cap`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="OnChainConfigDao.md#0x1_OnChainConfigDao_config_cap">config_cap</a>&lt;TokenT: store, ConfigT: <b>copy</b>, drop, store&gt;(): <a href="Config.md#0x1_Config_ModifyConfigCapability">Config::ModifyConfigCapability</a>&lt;ConfigT&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>friend</b>) <b>fun</b> <a href="OnChainConfigDao.md#0x1_OnChainConfigDao_config_cap">config_cap</a>&lt;TokenT: store, ConfigT: <b>copy</b> + drop + store&gt;():<a href="Config.md#0x1_Config_ModifyConfigCapability">Config::ModifyConfigCapability</a>&lt;ConfigT&gt;<b>acquires</b> <a href="OnChainConfigDao.md#0x1_OnChainConfigDao_WrappedConfigModifyCapability">WrappedConfigModifyCapability</a>{
<b>let</b> <a href="OnChainConfigDao.md#0x1_OnChainConfigDao_WrappedConfigModifyCapability">WrappedConfigModifyCapability</a> &lt;TokenT, ConfigT&gt;{cap} = <b>move_from</b>&lt;<a href="OnChainConfigDao.md#0x1_OnChainConfigDao_WrappedConfigModifyCapability">WrappedConfigModifyCapability</a>&lt;TokenT, ConfigT&gt;&gt;(<a href="CoreAddresses.md#0x1_CoreAddresses_GENESIS_ADDRESS">CoreAddresses::GENESIS_ADDRESS</a>());
cap
}
</code></pre>



</details>

<a name="@Module_Specification_1"></a>
Expand Down
2 changes: 0 additions & 2 deletions build/StarcoinFramework/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ This is the root document for the Move StarcoinFramework module documentation. T
- [`0x1::Signer`](Signer.md#0x1_Signer)
- [`0x1::SnapshotUtil`](SnapshotUtil.md#0x1_SnapshotUtil)
- [`0x1::StakeToSBTPlugin`](StakeToSBTPlugin.md#0x1_StakeToSBTPlugin)
- [`0x1::StarcoinDAO`](StarcoinDAO.md#0x1_StarcoinDAO)
- [`0x1::StarcoinVerifier`](StarcoinVerifier.md#0x1_StarcoinVerifier)
- [`0x1::StdlibUpgradeScripts`](StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts)
- [`0x1::StructuredHash`](StarcoinVerifier.md#0x1_StructuredHash)
Expand All @@ -108,7 +107,6 @@ This is the root document for the Move StarcoinFramework module documentation. T
- [`0x1::TypeInfo`](TypeInfo.md#0x1_TypeInfo)
- [`0x1::U256`](U256.md#0x1_U256)
- [`0x1::UpgradeModuleDaoProposal`](UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal)
- [`0x1::UpgradeModulePlugin`](UpgradeModulePlugin.md#0x1_UpgradeModulePlugin)
- [`0x1::VMConfig`](VMConfig.md#0x1_VMConfig)
- [`0x1::Vector`](Vector.md#0x1_Vector)
- [`0x1::Version`](Version.md#0x1_Version)
Expand Down
51 changes: 0 additions & 51 deletions build/StarcoinFramework/docs/StdlibUpgradeScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ The module for StdlibUpgrade init scripts
- [Function `do_upgrade_from_v7_to_v8`](#0x1_StdlibUpgradeScripts_do_upgrade_from_v7_to_v8)
- [Function `upgrade_from_v11_to_v12`](#0x1_StdlibUpgradeScripts_upgrade_from_v11_to_v12)
- [Function `do_upgrade_from_v11_to_v12`](#0x1_StdlibUpgradeScripts_do_upgrade_from_v11_to_v12)
- [Function `upgrade_from_v12_to_v12_1`](#0x1_StdlibUpgradeScripts_upgrade_from_v12_to_v12_1)
- [Function `do_upgrade_from_v12_to_v12_1`](#0x1_StdlibUpgradeScripts_do_upgrade_from_v12_to_v12_1)
- [Module Specification](#@Module_Specification_0)


Expand All @@ -37,7 +35,6 @@ The module for StdlibUpgrade init scripts
<b>use</b> <a href="Oracle.md#0x1_Oracle">0x1::Oracle</a>;
<b>use</b> <a href="STC.md#0x1_STC">0x1::STC</a>;
<b>use</b> <a href="Oracle.md#0x1_STCUSDOracle">0x1::STCUSDOracle</a>;
<b>use</b> <a href="StarcoinDAO.md#0x1_StarcoinDAO">0x1::StarcoinDAO</a>;
<b>use</b> <a href="Timestamp.md#0x1_Timestamp">0x1::Timestamp</a>;
<b>use</b> <a href="Token.md#0x1_Token">0x1::Token</a>;
<b>use</b> <a href="Treasury.md#0x1_Treasury">0x1::Treasury</a>;
Expand Down Expand Up @@ -349,54 +346,6 @@ deprecated, use <code>do_upgrade_from_v6_to_v7_with_language_version</code>.



</details>

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

## Function `upgrade_from_v12_to_v12_1`



<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_upgrade_from_v12_to_v12_1">upgrade_from_v12_to_v12_1</a>()
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>script</b>) <b>fun</b> <a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_upgrade_from_v12_to_v12_1">upgrade_from_v12_to_v12_1</a>() {
<a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_do_upgrade_from_v12_to_v12_1">do_upgrade_from_v12_to_v12_1</a>();
}
</code></pre>



</details>

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

## Function `do_upgrade_from_v12_to_v12_1`



<pre><code><b>public</b> <b>fun</b> <a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_do_upgrade_from_v12_to_v12_1">do_upgrade_from_v12_to_v12_1</a>()
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_do_upgrade_from_v12_to_v12_1">do_upgrade_from_v12_to_v12_1</a>() {
<a href="StarcoinDAO.md#0x1_StarcoinDAO_create_dao">StarcoinDAO::create_dao</a>( 60000, 120000, 10, 10000, 0);
}
</code></pre>



</details>

<a name="@Module_Specification_0"></a>
Expand Down
27 changes: 7 additions & 20 deletions build/StarcoinFramework/docs/UpgradeModuleDaoProposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ UpgradeModuleDaoProposal is a proposal moudle used to upgrade contract codes und
- [Struct `UpgradeModuleV2`](#0x1_UpgradeModuleDaoProposal_UpgradeModuleV2)
- [Constants](#@Constants_0)
- [Function `plugin`](#0x1_UpgradeModuleDaoProposal_plugin)
- [Function `get_genesis_upgrade_cap`](#0x1_UpgradeModuleDaoProposal_get_genesis_upgrade_cap)
- [Function `propose_module_upgrade_v2`](#0x1_UpgradeModuleDaoProposal_propose_module_upgrade_v2)
- [Function `submit_module_upgrade_plan`](#0x1_UpgradeModuleDaoProposal_submit_module_upgrade_plan)
- [Module Specification](#@Module_Specification_1)
Expand Down Expand Up @@ -214,28 +213,16 @@ If this goverment can upgrade module, call this to register capability.



</details>

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

## Function `get_genesis_upgrade_cap`

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


<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_get_genesis_upgrade_cap">get_genesis_upgrade_cap</a>&lt;TokenT: store&gt;(): <a href="PackageTxnManager.md#0x1_PackageTxnManager_UpgradePlanCapability">PackageTxnManager::UpgradePlanCapability</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> (<b>friend</b>) <b>fun</b> <a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_get_genesis_upgrade_cap">get_genesis_upgrade_cap</a>&lt;TokenT:store&gt;():<a href="PackageTxnManager.md#0x1_PackageTxnManager_UpgradePlanCapability">PackageTxnManager::UpgradePlanCapability</a> <b>acquires</b> <a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_UpgradeModuleCapability">UpgradeModuleCapability</a>{
<b>let</b> <a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_UpgradeModuleCapability">UpgradeModuleCapability</a>&lt;TokenT&gt;{
cap
} = <b>move_from</b>(<a href="Token.md#0x1_Token_token_address">Token::token_address</a>&lt;TokenT&gt;());
cap
<pre><code><b>schema</b> <a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_AbortIfUnableUpgrade">AbortIfUnableUpgrade</a>&lt;TokenT&gt; {
module_address: <b>address</b>;
<b>let</b> token_issuer = <a href="Token.md#0x1_Token_SPEC_TOKEN_TEST_ADDRESS">Token::SPEC_TOKEN_TEST_ADDRESS</a>();
<b>aborts_if</b> !<b>exists</b>&lt;<a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_UpgradeModuleCapability">UpgradeModuleCapability</a>&lt;TokenT&gt;&gt;(token_issuer);
<b>let</b> cap = <b>global</b>&lt;<a href="UpgradeModuleDaoProposal.md#0x1_UpgradeModuleDaoProposal_UpgradeModuleCapability">UpgradeModuleCapability</a>&lt;TokenT&gt;&gt;(token_issuer).cap;
<b>aborts_if</b> <a href="PackageTxnManager.md#0x1_PackageTxnManager_account_address">PackageTxnManager::account_address</a>(cap) != module_address;
}
</code></pre>

Expand Down
Binary file modified build/StarcoinFramework/source_maps/Account.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/Genesis.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/GenesisSignerCapability.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/OnChainConfigDao.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/StdlibUpgradeScripts.mvsm
Binary file not shown.
Binary file modified build/StarcoinFramework/source_maps/UpgradeModuleDaoProposal.mvsm
Binary file not shown.
6 changes: 3 additions & 3 deletions integration-tests/daospace/dao_account.exp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ processed 6 tasks

task 2 'run'. lines 6-23:
{
"gas_used": 858490,
"gas_used": 837509,
"status": "Executed"
}

Expand All @@ -14,7 +14,7 @@ task 3 'run'. lines 28-40:

task 4 'run'. lines 42-51:
{
"gas_used": 733860,
"gas_used": 712879,
"status": {
"MoveAbort": {
"location": {
Expand All @@ -30,7 +30,7 @@ task 4 'run'. lines 42-51:

task 5 'run'. lines 53-61:
{
"gas_used": 732629,
"gas_used": 711648,
"status": {
"MoveAbort": {
"location": {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_ext.exp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ processed 9 tasks

task 6 'run'. lines 56-65:
{
"gas_used": 938063,
"gas_used": 917082,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_grant.exp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ task 5 'run'. lines 13-21:

task 8 'run'. lines 100-109:
{
"gas_used": 1195699,
"gas_used": 1174718,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_proposal.exp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ processed 42 tasks

task 7 'run'. lines 150-159:
{
"gas_used": 1192902,
"gas_used": 1171921,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/dao_upgrade.exp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task 8 'run'. lines 87-101:

task 9 'run'. lines 102-111:
{
"gas_used": 1012753,
"gas_used": 991772,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/stake_to_sbt_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ task 4 'run'. lines 9-17:

task 6 'run'. lines 61-69:
{
"gas_used": 1288799,
"gas_used": 1267818,
"status": "Executed"
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/daospace/xdao.exp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ processed 4 tasks

task 3 'run'. lines 54-61:
{
"gas_used": 1074271,
"gas_used": 1053290,
"status": "Executed"
}
2 changes: 1 addition & 1 deletion integration-tests/daospaceplugin/mint_proposal_plugin.exp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ task 8 'run'. lines 71-85:

task 9 'run'. lines 87-96:
{
"gas_used": 1127518,
"gas_used": 1106537,
"status": "Executed"
}

Expand Down
7 changes: 0 additions & 7 deletions integration-tests/starcoin_dao/starcoin_dao.exp

This file was deleted.

16 changes: 0 additions & 16 deletions integration-tests/starcoin_dao/starcoin_dao.move

This file was deleted.

8 changes: 0 additions & 8 deletions sources/Account.move
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module Account {
use StarcoinFramework::STC::{Self, STC};
use StarcoinFramework::BCS;

friend StarcoinFramework::StarcoinDAO;

spec module {
pragma verify = false;
pragma aborts_if_is_strict = true;
Expand Down Expand Up @@ -193,12 +191,6 @@ module Account {
signer_cap
}

//TODO: Create StarcoinDAO , need modify or remove get_genesis_capability soon
public (friend) fun get_genesis_capability():SignerCapability{
let signer_cap = SignerCapability {addr: Token::token_address<STC>() };
signer_cap
}

public fun create_signer_with_cap(cap: &SignerCapability): signer {
create_signer(cap.addr)
}
Expand Down
1 change: 0 additions & 1 deletion sources/Genesis.move
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ module Genesis {

};
StdlibUpgradeScripts::do_upgrade_from_v11_to_v12();
StdlibUpgradeScripts::do_upgrade_from_v12_to_v12_1();
//Start time, Timestamp::is_genesis() will return false. this call should at the end of genesis init.
Timestamp::set_time_has_started(&genesis_account);
Account::release_genesis_signer(genesis_account);
Expand Down
Loading

0 comments on commit 44eda15

Please sign in to comment.