narodnik 4 лет назад
Родитель
Сommit
52b0e146eb
2 измененных файлов с 16 добавлено и 1 удалено
  1. 15 0
      bin/daod/proof/dao-exec.zk
  2. 1 1
      bin/daod/src/dao_contract/exec/wallet.rs

+ 15 - 0
bin/daod/proof/dao-exec.zk

@@ -50,5 +50,20 @@ circuit "DaoExec" {
         proposal_blind,
     );
     constrain_instance(proposal_bulla);
+
+    # Create coin 0
+    # Create coin 1
+    # Check values of coin 0 + coin 1 == input value
+    # Check value of coin 0 == proposal_amount
+    # Check public key matches too
+    # Create the input value commit
+    # Create the value commits
+
+    # Check total_votes >= dao_quorum
+    # Check win_votes / total_votes >= approval_ratio
+
+    # NOTE: there is a vulnerability here where someone can create the exec
+    # transaction with a bad note so it cannot be decrypted by the receiver
+    # TODO: research verifiable encryption inside ZK
 }
 

+ 1 - 1
bin/daod/src/dao_contract/exec/wallet.rs

@@ -113,7 +113,7 @@ impl Builder {
         debug!(target: "example_contract::foo::wallet::Builder", "input_proof Proof::create()");
         let proving_key = &zk_info.proving_key;
         let input_proof = Proof::create(proving_key, &[circuit], &public_inputs, &mut OsRng)
-            .expect("Example::foo() proving error!)");
+            .expect("DAO::exec() proving error!)");
         proofs.push(input_proof);
 
         let call_data = CallData { proposal: proposal_bulla };