You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

  1. #!/bin/sh
  2. # npm install
  3. rm -r build
  4. mkdir build
  5. cd build
  6. echo $(date +"%T") "circom ../circuits/withdraw.circom --r1cs --wasm --sym"
  7. itime="$(date -u +%s)"
  8. ../node_modules/.bin/circom ../circuits/withdraw.circom --r1cs --wasm --sym
  9. ftime="$(date -u +%s)"
  10. echo " ($(($(date -u +%s)-$itime))s)"
  11. echo $(date +"%T") "snarkjs info -r withdraw.r1cs"
  12. ../node_modules/.bin/snarkjs info -r withdraw.r1cs
  13. echo $(date +"%T") "snarkjs setup"
  14. itime="$(date -u +%s)"
  15. ../node_modules/.bin/snarkjs setup -r withdraw.r1cs
  16. echo " ($(($(date -u +%s)-$itime))s)"
  17. echo $(date +"%T") "trusted setup generated"
  18. # sed -i 's/null/["0","0","0"]/g' proving_key.json
  19. echo $(date +"%T") "snarkjs generateverifier"
  20. itime="$(date -u +%s)"
  21. ../node_modules/.bin/snarkjs generateverifier
  22. echo " ($(($(date -u +%s)-$itime))s)"
  23. echo $(date +"%T") "generateverifier generated"
  24. sed -i "s/solidity ^0.5.0/solidity ^0.6.0/g" verifier.sol
  25. sed -i "s/gas/gas()/g" verifier.sol
  26. sed -i "s/return the sum/return r the sum/g" verifier.sol
  27. sed -i "s/return the product/return r the product/g" verifier.sol
  28. cp verifier.sol ../contracts/verifier.sol