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

[dao] Implement DAOSpace #32

Merged
merged 35 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
03106a4
[genesis_dao] Implement GenesisDao
jolestar Jun 7, 2022
5d13575
Implement Proposal
jolestar Jun 21, 2022
e34ccee
Init MemberJoinPlugin
jolestar Jun 23, 2022
e94b12e
implement InstallPluginProposalPlugin
jolestar Jun 24, 2022
d52b8c7
update build
jolestar Jun 21, 2022
7d013e1
update build
jolestar Jun 24, 2022
4c3cd3b
Merge branch 'main' into genesis_dao
jolestar Jun 28, 2022
d0b5690
Implement DaoAccount and GenesisDao module (#46)
jolestar Jun 29, 2022
131c121
Update BuildInfo.yaml
jolestar Jun 29, 2022
b4870d9
merge Dao proposal and dao config into genesis dao base code (#47)
baichuan3 Jun 29, 2022
36242c8
Merge branch 'main' into genesis_dao
jolestar Jun 29, 2022
72173ab
Update BuildInfo.yaml
jolestar Jun 29, 2022
e3306a6
Genesis dao plugin (#49)
welbon Jul 1, 2022
fdddff4
Dao account test (#53)
jolestar Jul 5, 2022
6856141
Add member event (#55)
WGB5445 Jul 5, 2022
5bd7b61
Merge branch 'main' into genesis_dao
jolestar Jul 5, 2022
f081d2e
Dao proposal implement (#57)
baichuan3 Jul 6, 2022
8b60212
Genesis dao test (#59)
jolestar Jul 7, 2022
2737469
checkpoints temp Test (#62)
WGB5445 Jul 8, 2022
5f3df4a
Grant plugin (#61)
WGB5445 Jul 11, 2022
e1317dc
Add the plugin code that to convert token to SBT amount (#64)
welbon Jul 14, 2022
5cd8c0a
Dao proposal test (#66)
baichuan3 Jul 16, 2022
af63eff
Dao event and get vote info api (#69)
baichuan3 Jul 19, 2022
38c8d65
event associate with dao id (#71)
baichuan3 Jul 19, 2022
7ba5d10
Change some functions into Script methods and fix part of the logic (…
WGB5445 Jul 19, 2022
cd1002d
[ Other ] Rename DaoSpace (#72)
WGB5445 Jul 22, 2022
ea66229
Add Grant view and Grant refund (#73)
WGB5445 Jul 26, 2022
322f919
[lib] Refactor include source dir
jolestar Jul 26, 2022
e17525c
Fix stake SBT plugin from one stake to multiple stake
welbon Jul 26, 2022
4bc5d65
DAOSpace error code (#74)
jolestar Jul 26, 2022
2e9928a
[Feature and test]Add dao_grant test and query_grant_info_total (#76)
WGB5445 Jul 26, 2022
0d7b1f4
Fixed the problems in PR that relationship between SBT and the staked…
welbon Jul 27, 2022
5ca37d6
Add some integration test for StakeToSBTPlugin
welbon Jul 29, 2022
7e798f5
Add some integration test for StakeToSBTPlugin
welbon Jul 29, 2022
4116929
Rename Dao to DAO (#79)
jolestar Jul 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Best-effort syntax highlighting for Move: just use Rust highlighter
*.move linguist-language=Rust

1 change: 1 addition & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- main
- genesis_dao

jobs:
build-and-test:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ packages-microsoft-prod.deb

# Move Build Output sources
build/StarcoinFramework/sources/*.move
StarcoinFramework
build/UnitTest

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
Expand Down
41 changes: 40 additions & 1 deletion build/StarcoinFramework/BuildInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: AccountScripts
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: AnyMemberPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: Arith
: StarcoinFramework
Expand Down Expand Up @@ -48,6 +51,9 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: Config
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: ConfigProposalPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: ConsensusConfig
: StarcoinFramework
Expand All @@ -57,6 +63,15 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: CoreAddresses
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: DAOAccount
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: DAORegistry
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: DAOSpace
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: Dao
: StarcoinFramework
Expand Down Expand Up @@ -102,6 +117,9 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: GenesisSignerCapability
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: GrantProposalPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: Hash
: StarcoinFramework
Expand All @@ -111,12 +129,18 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: IdentifierNFTScripts
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: InstallPluginProposalPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: LanguageVersion
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: Math
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: MemberProposalPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: MerkleNFTDistributor
: StarcoinFramework
Expand Down Expand Up @@ -177,6 +201,9 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: Ring
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: SBTVoteStrategy
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: SIP_2
: StarcoinFramework
Expand All @@ -189,6 +216,9 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: STCUSDOracle
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: SalaryGovPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: SharedEd25519PublicKey
: StarcoinFramework
Expand All @@ -201,6 +231,12 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: Signer
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: SnapshotUtil
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: StakeToSBTPlugin
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: StarcoinVerifier
: StarcoinFramework
Expand Down Expand Up @@ -258,13 +294,16 @@ compiled_package_info:
? address: "0x00000000000000000000000000000001"
name: Version
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: VoteStrategy
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: YieldFarming
: StarcoinFramework
? address: "0x00000000000000000000000000000001"
name: YieldFarmingV2
: StarcoinFramework
source_digest: 9D5BEAD2A40807817B23BF8C474DA0D8ADC2A14B229B1CF06B74F8726614B3F9
source_digest: D4A0505A7143DE3CDB2D105E4AF48EECC0F76D91401116EE325D7DA501BC913C
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file modified build/StarcoinFramework/bytecode_modules/BCS.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/Block.mv
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/Genesis.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/StarcoinFramework/bytecode_modules/StdlibUpgradeScripts.mv
Binary file not shown.
85 changes: 84 additions & 1 deletion build/StarcoinFramework/docs/BCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ published on-chain.
- [Function `to_bytes`](#0x1_BCS_to_bytes)
- [Function `to_address`](#0x1_BCS_to_address)
- [Function `deserialize_option_bytes_vector`](#0x1_BCS_deserialize_option_bytes_vector)
- [Function `deserialize_option_tuple`](#0x1_BCS_deserialize_option_tuple)
- [Function `deserialize_bytes_vector`](#0x1_BCS_deserialize_bytes_vector)
- [Function `deserialize_u64_vector`](#0x1_BCS_deserialize_u64_vector)
- [Function `deserialize_u128_vector`](#0x1_BCS_deserialize_u128_vector)
Expand Down Expand Up @@ -44,6 +45,7 @@ published on-chain.
- [Function `skip_u64`](#0x1_BCS_skip_u64)
- [Function `skip_u32`](#0x1_BCS_skip_u32)
- [Function `skip_u16`](#0x1_BCS_skip_u16)
- [Function `skip_u8`](#0x1_BCS_skip_u8)
- [Function `skip_address`](#0x1_BCS_skip_address)
- [Function `skip_bool`](#0x1_BCS_skip_bool)
- [Function `can_skip`](#0x1_BCS_can_skip)
Expand Down Expand Up @@ -196,6 +198,50 @@ Return the address of key bytes



</details>

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

## Function `deserialize_option_tuple`



<pre><code><b>public</b> <b>fun</b> <a href="BCS.md#0x1_BCS_deserialize_option_tuple">deserialize_option_tuple</a>(input: &vector&lt;u8&gt;, offset: u64): (<a href="Option.md#0x1_Option_Option">Option::Option</a>&lt;vector&lt;u8&gt;&gt;, <a href="Option.md#0x1_Option_Option">Option::Option</a>&lt;vector&lt;u8&gt;&gt;, u64)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="BCS.md#0x1_BCS_deserialize_option_tuple">deserialize_option_tuple</a>(input: &vector&lt;u8&gt;, offset: u64): (<a href="Option.md#0x1_Option_Option">Option::Option</a>&lt;vector&lt;u8&gt;&gt;, <a href="Option.md#0x1_Option_Option">Option::Option</a>&lt;vector&lt;u8&gt;&gt;, u64) {
<b>let</b> (tag, new_offset) = <a href="BCS.md#0x1_BCS_deserialize_option_tag">deserialize_option_tag</a>(input, offset);
<b>if</b> (!tag) {
<b>return</b> (<a href="Option.md#0x1_Option_none">Option::none</a>&lt;vector&lt;u8&gt;&gt;(), <a href="Option.md#0x1_Option_none">Option::none</a>&lt;vector&lt;u8&gt;&gt;(), new_offset)
} <b>else</b> {
<b>let</b> (bs1, new_offset) = <a href="BCS.md#0x1_BCS_deserialize_bytes">deserialize_bytes</a>(input, new_offset);
<b>let</b> (bs2, new_offset) = <a href="BCS.md#0x1_BCS_deserialize_bytes">deserialize_bytes</a>(input, new_offset);

(<a href="Option.md#0x1_Option_some">Option::some</a>&lt;vector&lt;u8&gt;&gt;(bs1), <a href="Option.md#0x1_Option_some">Option::some</a>&lt;vector&lt;u8&gt;&gt;(bs2), new_offset)
}
}
</code></pre>



</details>

<details>
<summary>Specification</summary>



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



</details>

<a name="0x1_BCS_deserialize_bytes_vector"></a>
Expand Down Expand Up @@ -840,7 +886,7 @@ Return the address of key bytes


<pre><code><b>fun</b> <a href="BCS.md#0x1_BCS_get_n_bytes">get_n_bytes</a>(input: &vector&lt;u8&gt;, offset: u64, n: u64): vector&lt;u8&gt; {
<b>assert</b>!(((offset + n) &lt;= <a href="Vector.md#0x1_Vector_length">Vector::length</a>(input)) && (offset &lt; offset + n), <a href="Errors.md#0x1_Errors_invalid_state">Errors::invalid_state</a>(<a href="BCS.md#0x1_BCS_ERR_INPUT_NOT_LARGE_ENOUGH">ERR_INPUT_NOT_LARGE_ENOUGH</a>));
<b>assert</b>!(((offset + n) &lt;= <a href="Vector.md#0x1_Vector_length">Vector::length</a>(input)) && (offset &lt;= offset + n), <a href="Errors.md#0x1_Errors_invalid_state">Errors::invalid_state</a>(<a href="BCS.md#0x1_BCS_ERR_INPUT_NOT_LARGE_ENOUGH">ERR_INPUT_NOT_LARGE_ENOUGH</a>));
<b>let</b> i = 0;
<b>let</b> content = <a href="Vector.md#0x1_Vector_empty">Vector::empty</a>&lt;u8&gt;();
<b>while</b> (i &lt; n) {
Expand Down Expand Up @@ -1468,6 +1514,43 @@ Return the address of key bytes



</details>

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

## Function `skip_u8`



<pre><code><b>public</b> <b>fun</b> <a href="BCS.md#0x1_BCS_skip_u8">skip_u8</a>(input: &vector&lt;u8&gt;, offset: u64): u64
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="BCS.md#0x1_BCS_skip_u8">skip_u8</a>(input: &vector&lt;u8&gt;, offset: u64): u64 {
<a href="BCS.md#0x1_BCS_can_skip">can_skip</a>(input, offset, 1 );
offset + 1
}
</code></pre>



</details>

<details>
<summary>Specification</summary>



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



</details>

<a name="0x1_BCS_skip_address"></a>
Expand Down
2 changes: 1 addition & 1 deletion build/StarcoinFramework/docs/Genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ 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>(&genesis_account);
<a href="StdlibUpgradeScripts.md#0x1_StdlibUpgradeScripts_do_upgrade_from_v11_to_v12">StdlibUpgradeScripts::do_upgrade_from_v11_to_v12</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