Skip to content

Commit a2be957

Browse files
authored
Merge pull request #109 from Leonets/dao-challenge
Dao challenge
2 parents 9a1d406 + 148e540 commit a2be957

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2602
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ Cargo.lock
1313
# Flamegraph profiles
1414
flamegraph.svg
1515
3-lending/LendingDApp/node_modules
16+
3-lending/LendingDApp/public/lending_dapp.wasm
17+
3-lending/LendingDApp/public/loan_application.wasm
18+
3-lending/LendingDApp/TODO.md

4-portfolio-management-yield-farming/BiddingDApp/transactions/take1.rtm

Lines changed: 0 additions & 6 deletions
This file was deleted.

5-DAO/ArchDAO/.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
rustdocflags = ["--document-private-items"]

5-DAO/ArchDAO/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
old/

5-DAO/ArchDAO/Cargo.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[package]
2+
name = "archdao"
3+
version = "1.0.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v0.6.0" }
8+
scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v0.6.0" }
9+
regex = "1"
10+
lazy_static = "1.4.0"
11+
12+
[dev-dependencies]
13+
radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v0.6.0" }
14+
#transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v0.6.0" }
15+
#scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v0.6.0" }
16+
17+
[profile.release]
18+
opt-level = 's' # Optimize for size.
19+
lto = true # Enable Link Time Optimization.
20+
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
21+
panic = 'abort' # Abort on panic.
22+
strip = "debuginfo" # Strip debug info.
23+
overflow-checks = true # Panic in the case of an overflow.
24+
25+
[lib]
26+
crate-type = ["cdylib", "lib"]
27+
28+
29+
30+
31+

5-DAO/ArchDAO/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
![](./archdao_black_mini.jpg)
2+
3+
# ArchDAO - A proposal DAO
4+
5+
This project aims to manage the votes of a group of people who wish to express their choices with respect to a series of projects that are already partially funded by the founders of the DAO and who therefore wish to be helped in defining the priorities of each individual project.
6+
7+
ArchDAO implements a crypto dao that serves for decentralized governance of business proposal from the initial stage to the approval and the execution stage
8+
9+
Proposers receive fungible vote tokens in return for their registering, with vote tokens representing shares of decision of the
10+
whole proposal approval process.
11+
Right to vote can be transferred and whoever holds them can at any time vote for a proposal.
12+
13+
Proposers can also fund the ArchDao with XRD tokens and receive back ARCH tokens, as the projects funded by ArchDAO makes profits the value of each ARCH token will increase.
14+
15+
The ArchDAO's managers can dynamically add and remove proposal, or ask to verify if the proposal trigger is satisfied for promoting a proposal into a into a project ready to be funded.
16+
17+
The votes are calculated using a conviction system, that means that each vote gets calculated at its value only after some epochs have passed (for at least 1000epoch) the same when you remove the vote, the removed vote will continue to be calculated for at least the some amount of epochs.
18+
19+
The ArchDAO can charge protocol fees, intended at producing profits for the ArchDAO's managers. Some or all of these protocol fees can go
20+
towards rewards for both the managers and the voters.
21+
22+
Both the managers and the voters can earn rewards when the project gets executed and when the execution produces a profit.
23+
24+
## Example
25+
26+
For this kind of project there are many use cases, since the cases can be innumerable then let's try to describe a specific use case for Radix.
27+
28+
Let's say that during one of the appointments defined 'RoundTable' it is decided that an extra funding of 1,000,000xrd should be divided between the departments, so each one will propose his idea which will then be voted through the DAO to obtain funding for each project that is proportional to the result of the votes obtained.
29+
30+
## Development issues
31+
32+
Unfortunately I was not able to dedicate the right time to the project and the features present are at most 50% of what I would have liked. In any case, considering the time spent, the result is a good starting point, moreover in this way it was possible to verify the progress with Scrypto 0.6 and run the first publication on Alphanet.
33+
34+
This time various transaction manifest files were developed and their testing was performed without the new TestRunner but using Resim through the test library, I also wanted to change the design and use owned components but this was not possible due to time.
35+
36+
I have to thank my friend Gigi who always prepares me some very nice logos and Jake who answered several of my questions!
37+
38+
## How to build the blueprints
39+
40+
Make sure you have the necessary toolchain installed, including the
41+
resim tool, see
42+
[here](https://docs.radixdlt.com/main/scrypto/getting-started/install-scrypto.html)
43+
for details. You will need Scrypto 0.6.0.
44+
- From the command line, in the `archdao` directory, run `cargo build`
45+
46+
### How to run the test suite
47+
48+
- Make sure you have the resim tool installed, see above.
49+
- From the command line, in the `archdao` directory, run `cargo test -- --test-threads=1 --nocapture`
50+
51+
### How to generate the documentation
52+
53+
- From the command line, in the `archdao` directory, run `cargo doc`
54+
55+
The generated web pages contain detailed documentation on how the blueprints work.
56+
57+
### Useful command
58+
scrypto test -- --nocapture
59+
cargo test -- --test-threads=1 --nocapture
60+
61+

5-DAO/ArchDAO/archdao2.jpg

132 KB
Loading

5-DAO/ArchDAO/archdao_black.jpg

85.1 KB
Loading

5-DAO/ArchDAO/archdao_black_mini.jpg

141 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Parameters:
2+
#
3+
# component: Address of the ArchDAO instance to use
4+
#
5+
# account: Account of user running the transaction. Must
6+
# be able to create proof of the admin badge.
7+
#
8+
# admin_badge: ResourceAddress of the admin badge.
9+
#
10+
# proposalProject: ComponentAddress of proposal component to add.
11+
CALL_METHOD
12+
ComponentAddress("${account}")
13+
"lock_fee"
14+
Decimal("10");
15+
16+
CALL_METHOD
17+
ComponentAddress("${account}")
18+
"create_proof"
19+
ResourceAddress("${admin_badge}");
20+
21+
CALL_METHOD
22+
ComponentAddress("${component}")
23+
"add_proposal"
24+
ComponentAddress("${proposal_project}")
25+
"${proposal}";

0 commit comments

Comments
 (0)