Skip to content

Commit 765ac16

Browse files
authored
Merge pull request #108 from unghuuduc/main
Peter's DAO challenge submission.
2 parents a2be957 + f63f74b commit 765ac16

File tree

87 files changed

+9739
-0
lines changed

Some content is hidden

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

87 files changed

+9739
-0
lines changed

5-DAO/Align/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Align Blueprint package
2+
3+
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4+
5+
This submission provides a blueprint package to create a Decentralized Autonomous Organization (DAO) on Web3. It used many advanced Decentralized Governance (DeGov) techiques to create solid alignment of interests while at the same time foster individual accountabilities and allow flexibility between trustlessness or affordable trustness.
6+
7+
The package consists of 5 blueprints: DAO blueprint to instantiate the DAO's core component, Community, Proposal, Treasury, LocalOracle blueprints to support interacting with the DAO.
8+
9+
There are also many helpful modules, contain strong typed structs to support these blueprints.
10+
11+
There are two extra blueprints for test purpose: TestFundraising and TestProposal blueprints.
12+
13+
## Quick start
14+
15+
1. Clone this git repository: `git clone https://github.com/radixdlt/scrypto-challenges && cd 5-DAO/Align`
16+
2. Quick test: `./tests.sh`
17+
3. Study the tests through logs and test each function, methods of the protocol.
18+
19+
**Documentation**:
20+
21+
1. Linux/Mac: `./doc.sh`
22+
2. Windows: `cd scrypto && cargo doc --no-deps --document-private-items --open`
23+
24+
**Alphanet intergration**: By the time of the challenge's deadline, there's some issues when trying to deploy large package into Alphanet. The author intended to test this package on Alphanet after the Radix team got it fixed.
25+
26+
## License
27+
28+
This project is licensed under [Apache 2.0](https://github.com/radixdlt/scrypto-challenges/blob/main/LICENSE).

5-DAO/Align/doc.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -e
5+
6+
cd "$(dirname "$0")"
7+
8+
cd scrypto;
9+
cargo doc --no-deps --document-private-items --open;

5-DAO/Align/scrypto/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
/target/
3+
4+
Cargo.lock

5-DAO/Align/scrypto/Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "align"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto"}
8+
scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto"}
9+
hex = "0.4.3"
10+
11+
[profile.release]
12+
opt-level = 's' # Optimize for size.
13+
lto = true # Enable Link Time Optimization.
14+
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
15+
panic = 'abort' # Abort on panic.
16+
strip = "debuginfo" # Strip debug info.
17+
18+
[lib]
19+
crate-type = ["cdylib", "lib"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CALL_METHOD ComponentAddress("${caller}") "lock_fee" Decimal("100");
2+
3+
CALL_METHOD ComponentAddress("${community_address}") "tax";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CALL_METHOD ComponentAddress("${caller}") "lock_fee" Decimal("100");
2+
3+
CALL_METHOD ComponentAddress("${caller}") "create_proof" ResourceAddress("${member_sbt}");
4+
5+
CALL_METHOD ComponentAddress("${community_address}") "amend_tax_policy" Decimal("${new_tax}");
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CALL_METHOD ComponentAddress("${caller}") "lock_fee" Decimal("100");
2+
3+
CALL_METHOD ComponentAddress("${caller}") "create_proof" ResourceAddress("${member_sbt}");
4+
5+
CALL_METHOD ComponentAddress("${community_address}") "review_request" ${id}u64 ${result};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CALL_METHOD ComponentAddress("${caller}") "lock_fee" Decimal("100");
2+
3+
CALL_METHOD ComponentAddress("${caller}") "create_proof" ResourceAddress("${sbt}");
4+
5+
POP_FROM_AUTH_ZONE Proof("sbt");
6+
7+
CALL_METHOD ComponentAddress("${community_address}") "join" Proof("sbt");
8+
9+
CALL_METHOD ComponentAddress("${caller}") "deposit_batch" Expression("ENTIRE_WORKTOP");
10+
# CALL_METHOD_WITH_ALL_RESOURCES ComponentAddress("${caller}") "deposit_batch";
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CALL_METHOD ComponentAddress("${caller}") "lock_fee" Decimal("100");
2+
3+
CALL_METHOD ComponentAddress("${caller}") "create_proof" ResourceAddress("${sbt}");
4+
5+
POP_FROM_AUTH_ZONE Proof("sbt");
6+
7+
CALL_METHOD ComponentAddress("${community_address}") "quit" Proof("sbt");
8+
9+
CALL_METHOD ComponentAddress("${caller}") "deposit_batch" Expression("ENTIRE_WORKTOP");
10+
# CALL_METHOD_WITH_ALL_RESOURCES ComponentAddress("${caller}") "deposit_batch";
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CALL_METHOD ComponentAddress("${caller}") "lock_fee" Decimal("100");
2+
3+
CALL_METHOD ComponentAddress("${caller}") "create_proof" ResourceAddress("${sbt}");
4+
5+
POP_FROM_AUTH_ZONE Proof("sbt");
6+
7+
CALL_METHOD ComponentAddress("${community_address}") "request_join" Proof("sbt");
8+
9+
CALL_METHOD ComponentAddress("${caller}") "deposit_batch" Expression("ENTIRE_WORKTOP");
10+
# CALL_METHOD_WITH_ALL_RESOURCES ComponentAddress("${caller}") "deposit_batch";

0 commit comments

Comments
 (0)