Closed SeiyaKobayashi closed 1 year ago
test coverage
-----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-----------------|----------|----------|----------|----------|----------------|
src/ | 100 | 100 | 96.43 | 100 | |
IVerifier.sol | 100 | 100 | 100 | 100 | |
Verifier.sol | 100 | 100 | 96.43 | 100 | |
src/libraries/ | 100 | 100 | 100 | 100 | |
Bytes.sol | 100 | 100 | 100 | 100 | |
Challenge.sol | 100 | 100 | 100 | 100 | |
MerkleTree.sol | 100 | 100 | 100 | 100 | |
-----------------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 96.88 | 100 | |
-----------------|----------|----------|----------|----------|----------------|
generate one verifier contract for one model using factory pattern
Done in 5f41476730294b2ed7ee5d832172aaf584bda9cf.
π¨ Overview
Implementation of commit-reveal scheme.
π Details
A.
VerifierFactory
contractconstructor
: contract constructor that initializes the address of the master verifier contract.createChildContract
: function that deploys a cloned (proxy) verifier contract.getModels
: function that fetches models.getModelsByOwnerAddress
: function that fetches models by the address of the requested model owner.getMasterVerifierContract
: function that fetches the address of the master verifier contract.getClonedVerifierContract
: function that fetches the address of the cloned verifier contract of the requested model.B.
Verifier
contractconstructor
: contract constructor that initializesdifficulty
.commitment
: function that stores commitments in the contract.getCommitment
: function that fetches details of the requested commitment (onlyOwner
).getCommitmentsOfModel
: function that fetches commitments of the requested model (onlyOwner
).getCommitmentsOfProver
: function that fetches commitments of the requested prover.updateChallenge
: function that updates the value of challenge of commitment.getDifficulty
: function that fetches difficulty of challenge (onlyOwner
).updateDifficulty
: function that updates difficulty of challenge (onlyOwner
).reveal
: function that verifies the given Merkle proofs.Bytes
: library of some bytes operations.Challenge
: library of challenge generation algorithm.MerkleTree
: library of some Merkle tree operations.π References