set the minimum stake amount as an input to enable dynamicity

This commit is contained in:
thomaslavaur 2024-08-07 08:40:19 +02:00
parent 7f4ccde70f
commit 6c53186245
3 changed files with 7 additions and 4 deletions

View File

@ -1243,6 +1243,7 @@ if merkle_hash == "Poseidon2":
with open("input.json", "w") as file: with open("input.json", "w") as file:
file.write('{\n\t"commitments_root" :\t\t"'+str(commitment_root)+'",') file.write('{\n\t"commitments_root" :\t\t"'+str(commitment_root)+'",')
file.write('{\n\t"minimum_stake" :\t\t"'+str(minimum_stake)+'",')
file.write('\n\t"constraints" :\t\t\t\t[') file.write('\n\t"constraints" :\t\t\t\t[')
for i in range(maximum_number_of_note): for i in range(maximum_number_of_note):
file.write('"') file.write('"')

View File

@ -110,8 +110,9 @@ template membership_checker(){
} }
template anemoi_proof_of_validator(max_notes, minimum_stake){ //TODO: put minimum_stake in the input to change it dynamically template anemoi_proof_of_validator(max_notes){
signal input commitments_root; signal input commitments_root;
signal input minimum_stake;
// Note variables // Note variables
signal input constraints[max_notes]; // Every note field represented as F_p elements for now (constraints are represented by their Merkle root) signal input constraints[max_notes]; // Every note field represented as F_p elements for now (constraints are represented by their Merkle root)
@ -222,4 +223,4 @@ template anemoi_proof_of_validator(max_notes, minimum_stake){ //TODO: put mini
} }
component main {public [commitments_root]} = anemoi_proof_of_validator(50,10000); component main {public [commitments_root, minimum_stake]} = anemoi_proof_of_validator(50);

View File

@ -110,8 +110,9 @@ template membership_checker(){
} }
template poseidon_proof_of_validator(max_notes, minimum_stake){ //TODO: put minimum_stake in the input to change it dynamically template poseidon_proof_of_validator(max_notes){
signal input commitments_root; signal input commitments_root;
signal input minimum_stake;
// Note variables // Note variables
signal input constraints[max_notes]; // Every note field represented as F_p elements for now (constraints are represented by their Merkle root) signal input constraints[max_notes]; // Every note field represented as F_p elements for now (constraints are represented by their Merkle root)
@ -223,4 +224,4 @@ template poseidon_proof_of_validator(max_notes, minimum_stake){ //TODO: put
} }
component main {public [commitments_root]} = poseidon_proof_of_validator(50,10000); component main {public [commitments_root, minimum_stake]} = poseidon_proof_of_validator(50);