First, install the project dependencies:
npm installThis project contains DVRF verification contracts plus scripts to deploy and benchmark them.
npx hardhat help
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy_dvrf.js
RUNS=1000 npx hardhat run scripts/gas_benchmark_dvrf.js
npx hardhat run scripts/compare_icy_glow.js
npx hardhat run scripts/deploy_dvrf_sepolia.js --network sepolia
npx hardhat run --network sepolia scripts/compare_icy_glow.js
RUNS=1 npx hardhat run --network sepolia scripts/gas_benchmark_dvrf_sepolia.js
Notes:
RUNSmust be a positive integer for both benchmark scripts.- On this Hardhat version,
npx hardhat run ... -- <runs>is not supported, so pass runs viaRUNS=<value>. - For Sepolia deployment, set
SEPOLIA_RPC_URLandPRIVATE_KEYin your environment or.env. scripts/compare_icy_glow.jsusesdebug_traceTransaction, so Sepolia trace comparisons require an RPC that exposes debug tracing.scripts/gas_benchmark_dvrf_sepolia.jswrites run artifacts tobenchmarks/(.log+.csv).
contracts/DVRF_Verify.sol: verification logic for DVRF-related proofs and pairing checks, including benchmark wrapper functions.
scripts/deploy_dvrf.js: local deployment helper forDVRF_Verify.scripts/deploy_dvrf_sepolia.js: deploysDVRF_Verifyto Sepolia.scripts/gas_benchmark_dvrf.js: measures gas usage for benchmark wrapper functions and prints distribution stats (avg, quartiles, range).scripts/gas_benchmark_dvrf_sepolia.js: benchmarksverifyIcy/verifyGLOWon Sepolia and writes.logand.csvoutputs tobenchmarks/.scripts/compare_icy_glow.js: comparesverifyIcyandverifyGLOWgas usage, including per-call trace summaries and calldata costs.
DVRF_Verify Sepolia adress: "0x48e4923bed992e13874f902cd17ec6daa36ffaf1"