|
|
@@ -63,6 +63,10 @@ async fn demo() -> Result<()> {
|
|
|
//// TODO: this will be moved to a different file
|
|
|
//example().await?;
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to init()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
// Money parameters
|
|
|
let xdrk_supply = 1_000_000;
|
|
|
let xdrk_token_id = pallas::Base::random(&mut OsRng);
|
|
|
@@ -142,6 +146,10 @@ async fn demo() -> Result<()> {
|
|
|
let dao_state = dao_contract::State::new();
|
|
|
states.register(*dao_contract::CONTRACT_ID, dao_state);
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to create()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
/////////////////////////////////////////////////////
|
|
|
////// Create the DAO bulla
|
|
|
/////////////////////////////////////////////////////
|
|
|
@@ -218,6 +226,10 @@ async fn demo() -> Result<()> {
|
|
|
};
|
|
|
debug!(target: "demo", "Create DAO bulla: {:?}", dao_bulla.0);
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to mint()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
///////////////////////////////////////////////////
|
|
|
//// Mint the initial supply of treasury token
|
|
|
//// and send it all to the DAO directly
|
|
|
@@ -320,6 +332,10 @@ async fn demo() -> Result<()> {
|
|
|
|
|
|
debug!("DAO received a coin worth {} xDRK", treasury_note.value);
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to airdrop()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
///////////////////////////////////////////////////
|
|
|
//// Mint the governance token
|
|
|
//// Send it to three hodlers
|
|
|
@@ -469,6 +485,10 @@ async fn demo() -> Result<()> {
|
|
|
// output 1: change address
|
|
|
///////////////////////////////////////////////////
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to propose()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
///////////////////////////////////////////////////
|
|
|
// Propose the vote
|
|
|
// In order to make a valid vote, first the proposer must
|
|
|
@@ -618,6 +638,10 @@ async fn demo() -> Result<()> {
|
|
|
// beginning of gov period
|
|
|
// Cannot use nullifiers from before voting period
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to vote()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
debug!(target: "demo", "Stage 5. Start voting");
|
|
|
|
|
|
// We were previously saving updates here for testing
|
|
|
@@ -941,6 +965,10 @@ async fn demo() -> Result<()> {
|
|
|
assert!(all_votes_commit == pedersen_commitment_u64(all_votes_value, all_votes_blind));
|
|
|
assert!(yes_votes_commit == pedersen_commitment_u64(yes_votes_value, yes_votes_blind));
|
|
|
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+ //// TODO: move to exec()
|
|
|
+ /////////////////////////////////////////////////
|
|
|
+
|
|
|
///////////////////////////////////////////////////
|
|
|
// Execute the vote
|
|
|
///////////////////////////////////////////////////
|