k = 13;
field = "pallas";

constant "DaoMint" {
    EcFixedPoint VALUE_COMMIT_RANDOM,
    EcFixedPointBase NULLIFIER_K,
}

witness "DaoMint" {
    Base dao_proposer_limit,
    Base dao_quorum,
    Base dao_approval_ratio_quot,
    Base dao_approval_ratio_base,
    Base gov_token_id,
    Base dao_secret,
    Base dao_bulla_blind,
}

circuit "DaoMint" {
    # This circuit states that the bulla is a hash of 8 values

    dao_public = ec_mul_base(dao_secret, NULLIFIER_K);
    dao_public_x = ec_get_x(dao_public);
    dao_public_y = ec_get_y(dao_public);
    constrain_instance(dao_public_x);
    constrain_instance(dao_public_y);

    bulla = poseidon_hash(
        dao_proposer_limit,
        dao_quorum,
        dao_approval_ratio_quot,
        dao_approval_ratio_base,
        gov_token_id,
        dao_public_x,
        dao_public_y,
        dao_bulla_blind,
    );

    constrain_instance(bulla);
}
