Expand description
§What to re-export, what to hide?
- export contract struct itself, but try to avoid export instance type (instead, use ::new() to get a handle)
- avoid exporting
xxCall
andxxReturn
types, they usually can be converted/transmuted from existing struct - Event types should be exported
- structs should be exported and renamed with
xxSol
suffix to avoid confusion with other rust types- see module doc for more explanation on types duplication issue in alloy
Generated by the following Solidity interface…
library BN254 {
type BaseField is uint256;
type ScalarField is uint256;
struct G1Point {
BaseField x;
BaseField y;
}
}
library IPlonkVerifier {
struct PlonkProof {
BN254.G1Point wire0;
BN254.G1Point wire1;
BN254.G1Point wire2;
BN254.G1Point wire3;
BN254.G1Point wire4;
BN254.G1Point prodPerm;
BN254.G1Point split0;
BN254.G1Point split1;
BN254.G1Point split2;
BN254.G1Point split3;
BN254.G1Point split4;
BN254.G1Point zeta;
BN254.G1Point zetaOmega;
BN254.ScalarField wireEval0;
BN254.ScalarField wireEval1;
BN254.ScalarField wireEval2;
BN254.ScalarField wireEval3;
BN254.ScalarField wireEval4;
BN254.ScalarField sigmaEval0;
BN254.ScalarField sigmaEval1;
BN254.ScalarField sigmaEval2;
BN254.ScalarField sigmaEval3;
BN254.ScalarField prodPermZetaOmegaEval;
}
struct VerifyingKey {
uint256 domainSize;
uint256 numInputs;
BN254.G1Point sigma0;
BN254.G1Point sigma1;
BN254.G1Point sigma2;
BN254.G1Point sigma3;
BN254.G1Point sigma4;
BN254.G1Point q1;
BN254.G1Point q2;
BN254.G1Point q3;
BN254.G1Point q4;
BN254.G1Point qM12;
BN254.G1Point qM34;
BN254.G1Point qO;
BN254.G1Point qC;
BN254.G1Point qH1;
BN254.G1Point qH2;
BN254.G1Point qH3;
BN254.G1Point qH4;
BN254.G1Point qEcc;
bytes32 g2LSB;
bytes32 g2MSB;
}
}
interface PlonkVerifierV2 {
error InvalidPlonkArgs();
error UnsupportedDegree();
error WrongPlonkVK();
function BETA_H_X0() external view returns (uint256);
function BETA_H_X1() external view returns (uint256);
function BETA_H_Y0() external view returns (uint256);
function BETA_H_Y1() external view returns (uint256);
function COSET_K1() external view returns (uint256);
function COSET_K2() external view returns (uint256);
function COSET_K3() external view returns (uint256);
function COSET_K4() external view returns (uint256);
function verify(IPlonkVerifier.VerifyingKey memory verifyingKey, uint256[11] memory publicInput, IPlonkVerifier.PlonkProof memory proof) external view returns (bool);
}
…which was generated by the following JSON ABI:
[
{
"type": "function",
"name": "BETA_H_X0",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "BETA_H_X1",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "BETA_H_Y0",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "BETA_H_Y1",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "COSET_K1",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "COSET_K2",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "COSET_K3",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "COSET_K4",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "verify",
"inputs": [
{
"name": "verifyingKey",
"type": "tuple",
"internalType": "struct IPlonkVerifier.VerifyingKey",
"components": [
{
"name": "domainSize",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "numInputs",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "sigma0",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "sigma1",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "sigma2",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "sigma3",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "sigma4",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "q1",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "q2",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "q3",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "q4",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qM12",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qM34",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qO",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qC",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qH1",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qH2",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qH3",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qH4",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "qEcc",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "g2LSB",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "g2MSB",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "publicInput",
"type": "uint256[11]",
"internalType": "uint256[11]"
},
{
"name": "proof",
"type": "tuple",
"internalType": "struct IPlonkVerifier.PlonkProof",
"components": [
{
"name": "wire0",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "wire1",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "wire2",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "wire3",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "wire4",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "prodPerm",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "split0",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "split1",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "split2",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "split3",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "split4",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "zeta",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "zetaOmega",
"type": "tuple",
"internalType": "struct BN254.G1Point",
"components": [
{
"name": "x",
"type": "uint256",
"internalType": "BN254.BaseField"
},
{
"name": "y",
"type": "uint256",
"internalType": "BN254.BaseField"
}
]
},
{
"name": "wireEval0",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "wireEval1",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "wireEval2",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "wireEval3",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "wireEval4",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "sigmaEval0",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "sigmaEval1",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "sigmaEval2",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "sigmaEval3",
"type": "uint256",
"internalType": "BN254.ScalarField"
},
{
"name": "prodPermZetaOmegaEval",
"type": "uint256",
"internalType": "BN254.ScalarField"
}
]
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"type": "error",
"name": "InvalidPlonkArgs",
"inputs": []
},
{
"type": "error",
"name": "UnsupportedDegree",
"inputs": []
},
{
"type": "error",
"name": "WrongPlonkVK",
"inputs": []
}
]
Structs§
- BETA_
H_ X0Call - Function with signature
BETA_H_X0()
and selector0x834c452a
.solidity function BETA_H_X0() external view returns (uint256);
- BETA_
H_ X0Return - Container type for the return parameters of the
BETA_H_X0()
function. - BETA_
H_ X1Call - Function with signature
BETA_H_X1()
and selector0xaf196ba2
.solidity function BETA_H_X1() external view returns (uint256);
- BETA_
H_ X1Return - Container type for the return parameters of the
BETA_H_X1()
function. - BETA_
H_ Y0Call - Function with signature
BETA_H_Y0()
and selector0xf5144326
.solidity function BETA_H_Y0() external view returns (uint256);
- BETA_
H_ Y0Return - Container type for the return parameters of the
BETA_H_Y0()
function. - BETA_
H_ Y1Call - Function with signature
BETA_H_Y1()
and selector0x4b4734e3
.solidity function BETA_H_Y1() external view returns (uint256);
- BETA_
H_ Y1Return - Container type for the return parameters of the
BETA_H_Y1()
function. - COSET_
K1Call - Function with signature
COSET_K1()
and selector0xe3512d56
.solidity function COSET_K1() external view returns (uint256);
- COSET_
K1Return - Container type for the return parameters of the
COSET_K1()
function. - COSET_
K2Call - Function with signature
COSET_K2()
and selector0x0c551f3f
.solidity function COSET_K2() external view returns (uint256);
- COSET_
K2Return - Container type for the return parameters of the
COSET_K2()
function. - COSET_
K3Call - Function with signature
COSET_K3()
and selector0x5a14c0fe
.solidity function COSET_K3() external view returns (uint256);
- COSET_
K3Return - Container type for the return parameters of the
COSET_K3()
function. - COSET_
K4Call - Function with signature
COSET_K4()
and selector0xde24ac0f
.solidity function COSET_K4() external view returns (uint256);
- COSET_
K4Return - Container type for the return parameters of the
COSET_K4()
function. - Invalid
Plonk Args - Custom error with signature
InvalidPlonkArgs()
and selector0xfd9a2d1b
.solidity error InvalidPlonkArgs();
- Plonk
Verifier V2Instance - A
PlonkVerifierV2
instance. - Unsupported
Degree - Custom error with signature
UnsupportedDegree()
and selector0xe2ef09e5
.solidity error UnsupportedDegree();
- Wrong
PlonkVK - Custom error with signature
WrongPlonkVK()
and selector0x41f53b12
.solidity error WrongPlonkVK();
- verify
Call - Function with signature
verify((uint256,uint256,(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),bytes32,bytes32),uint256[11],((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))
and selector0xab959ee3
.solidity function verify(IPlonkVerifier.VerifyingKey memory verifyingKey, uint256[11] memory publicInput, IPlonkVerifier.PlonkProof memory proof) external view returns (bool);
- verify
Return - Container type for the return parameters of the
verify((uint256,uint256,(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),bytes32,bytes32),uint256[11],((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))
function.
Enums§
- Plonk
Verifier V2Calls - Container for all the
PlonkVerifierV2
function calls. - Plonk
Verifier V2Errors - Container for all the
PlonkVerifierV2
custom errors.
Statics§
- BYTECODE
- The creation / init bytecode of the contract.
- DEPLOYED_
BYTECODE - The runtime bytecode of the contract, as deployed on the network.
Functions§
- deploy
- Deploys this contract using the given
provider
and constructor arguments, if any. - deploy_
builder - Creates a
RawCallBuilder
for deploying this contract using the givenprovider
and constructor arguments, if any. - new
- Creates a new wrapper around an on-chain
PlonkVerifierV2
contract instance.