mod.rs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. use lazy_static::lazy_static;
  2. use pasta_curves::{group::ff::Field, pallas};
  3. use rand::rngs::OsRng;
  4. pub mod validate;
  5. /// This is an anonymous contract function that mutates the internal DAO state.
  6. ///
  7. /// Corresponds to `mint(proposer_limit, quorum, approval_ratio, dao_pubkey, dao_blind)`
  8. ///
  9. /// The prover creates a `Builder`, which then constructs the `Tx` that the verifier can
  10. /// check using `state_transition()`.
  11. ///
  12. /// # Arguments
  13. ///
  14. /// * `proposer_limit` - Number of governance tokens that holder must possess in order to
  15. /// propose a new vote.
  16. /// * `quorum` - Number of minimum votes that must be met for a proposal to pass.
  17. /// * `approval_ratio` - Ratio of winning to total votes for a proposal to pass.
  18. /// * `dao_pubkey` - Public key of the DAO for permissioned access. This can also be
  19. /// shared publicly if you want a full decentralized DAO.
  20. /// * `dao_blind` - Blinding factor for the DAO bulla.
  21. ///
  22. /// # Example
  23. ///
  24. /// ```rust
  25. /// let dao_proposer_limit = 110;
  26. /// let dao_quorum = 110;
  27. /// let dao_approval_ratio = 2;
  28. ///
  29. /// let builder = dao_contract::Mint::Builder(
  30. /// dao_proposer_limit,
  31. /// dao_quorum,
  32. /// dao_approval_ratio,
  33. /// gov_token_id,
  34. /// dao_pubkey,
  35. /// dao_blind
  36. /// );
  37. /// let tx = builder.build();
  38. /// ```
  39. pub mod wallet;
  40. lazy_static! {
  41. pub static ref FUNC_ID: pallas::Base = pallas::Base::random(&mut OsRng);
  42. }