Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- SP1Verifier
- Optimization enabled
- false
- Compiler version
- v0.8.28+commit.7893614a
- EVM Version
- Verified at
- 2026-11-19T13:51:09.249991Z
Constructor Arguments
src/hardened/vendor/sp1-contracts/v6.1.0/SP1VerifierGroth16.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ISP1Verifier, ISP1VerifierWithHash} from "../ISP1Verifier.sol";
import {Verifier} from "./Groth16Verifier.sol";
/// @title SP1 Verifier
/// @author Succinct Labs
/// @notice This contracts implements a solidity verifier for SP1.
contract SP1Verifier is Verifier, ISP1VerifierWithHash {
/// @notice Thrown when the verifier selector from this proof does not match the one in this
/// verifier. This indicates that this proof was sent to the wrong verifier.
/// @param received The verifier selector from the first 4 bytes of the proof.
/// @param expected The verifier selector from the first 4 bytes of the VERIFIER_HASH().
error WrongVerifierSelector(bytes4 received, bytes4 expected);
/// @notice Thrown when the exit code is invalid.
error InvalidExitCode();
/// @notice Thrown when the proof is invalid.
error InvalidProof();
/// @notice Thrown when the vkRoot is invalid.
error InvalidVkRoot();
/// @notice The version of the circuit.
function VERSION() external pure returns (string memory) {
return "v6.1.0";
}
/// @inheritdoc ISP1VerifierWithHash
function VERIFIER_HASH() public pure returns (bytes32) {
return 0x4388a21c687fdd5f218d7e3d13190cac4c5355818d3605fd5fb811df468ee696;
}
/// @notice The recursion vk root.
function VK_ROOT() public pure returns (bytes32) {
return 0x002f850ee998974d6cc00e50cd0814b098c05bfade466d28573240d057f25352;
}
/// @notice Hashes the public values to a field elements inside Bn254.
/// @param publicValues The public values.
function hashPublicValues(bytes calldata publicValues) public pure returns (bytes32) {
return sha256(publicValues) & bytes32(uint256((1 << 253) - 1));
}
/// @notice Verifies a proof with given public values and vkey.
/// @param programVKey The verification key for the RISC-V program.
/// @param publicValues The public values encoded as bytes.
/// @param proofBytes The proof of the program execution the SP1 zkVM encoded as bytes.
function verifyProof(
bytes32 programVKey,
bytes calldata publicValues,
bytes calldata proofBytes
) external view {
bytes4 receivedSelector = bytes4(proofBytes[:4]);
bytes4 expectedSelector = bytes4(VERIFIER_HASH());
if (receivedSelector != expectedSelector) {
revert WrongVerifierSelector(receivedSelector, expectedSelector);
}
uint256 expectedVkRoot = uint256(VK_ROOT());
bytes32 publicValuesDigest = hashPublicValues(publicValues);
(uint256 exitCode, uint256 vkRoot, uint256 nonce, uint256[8] memory proof) =
abi.decode(proofBytes[4:], (uint256, uint256, uint256, uint256[8]));
uint256[5] memory inputs;
inputs[0] = uint256(programVKey);
inputs[1] = uint256(publicValuesDigest);
inputs[2] = exitCode;
inputs[3] = vkRoot;
inputs[4] = nonce;
if (exitCode != 0) {
revert InvalidExitCode();
}
if (vkRoot != expectedVkRoot) {
revert InvalidVkRoot();
}
this.verifyProof(proof, inputs);
}
}
src/hardened/vendor/sp1-contracts/ISP1Verifier.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @title SP1 Verifier Interface
/// @author Succinct Labs
/// @notice This contract is the interface for the SP1 Verifier.
interface ISP1Verifier {
/// @notice Verifies a proof with given public values and vkey.
/// @dev It is expected that the first 4 bytes of proofBytes must match the first 4 bytes of
/// target verifier's VERIFIER_HASH.
/// @param programVKey The verification key for the RISC-V program.
/// @param publicValues The public values encoded as bytes.
/// @param proofBytes The proof of the program execution the SP1 zkVM encoded as bytes.
function verifyProof(
bytes32 programVKey,
bytes calldata publicValues,
bytes calldata proofBytes
) external view;
}
interface ISP1VerifierWithHash is ISP1Verifier {
/// @notice Returns the hash of the verifier.
function VERIFIER_HASH() external pure returns (bytes32);
}
src/hardened/vendor/sp1-contracts/v6.1.0/Groth16Verifier.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @title Groth16 verifier template.
/// @author Remco Bloemen
/// @notice Supports verifying Groth16 proofs. Proofs can be in uncompressed
/// (256 bytes) and compressed (128 bytes) format. A view function is provided
/// to compress proofs.
/// @notice See <https://2π.com/23/bn254-compression> for further explanation.
contract Verifier {
/// Some of the provided public input values are larger than the field modulus.
/// @dev Public input elements are not automatically reduced, as this is can be
/// a dangerous source of bugs.
error PublicInputNotInField();
/// The proof is invalid.
/// @dev This can mean that provided Groth16 proof points are not on their
/// curves, that pairing equation fails, or that the proof is not for the
/// provided public input.
error ProofInvalid();
// Addresses of precompiles
uint256 constant PRECOMPILE_MODEXP = 0x05;
uint256 constant PRECOMPILE_ADD = 0x06;
uint256 constant PRECOMPILE_MUL = 0x07;
uint256 constant PRECOMPILE_VERIFY = 0x08;
// Base field Fp order P and scalar field Fr order R.
// For BN254 these are computed as follows:
// t = 4965661367192848881
// P = 36⋅t⁴ + 36⋅t³ + 24⋅t² + 6⋅t + 1
// R = 36⋅t⁴ + 36⋅t³ + 18⋅t² + 6⋅t + 1
uint256 constant P = 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47;
uint256 constant R = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001;
// Extension field Fp2 = Fp[i] / (i² + 1)
// Note: This is the complex extension field of Fp with i² = -1.
// Values in Fp2 are represented as a pair of Fp elements (a₀, a₁) as a₀ + a₁⋅i.
// Note: The order of Fp2 elements is *opposite* that of the pairing contract, which
// expects Fp2 elements in order (a₁, a₀). This is also the order in which
// Fp2 elements are encoded in the public interface as this became convention.
// Constants in Fp
uint256 constant FRACTION_1_2_FP = 0x183227397098d014dc2822db40c0ac2ecbc0b548b438e5469e10460b6c3e7ea4;
uint256 constant FRACTION_27_82_FP = 0x2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5;
uint256 constant FRACTION_3_82_FP = 0x2fcd3ac2a640a154eb23960892a85a68f031ca0c8344b23a577dcf1052b9e775;
// Exponents for inversions and square roots mod P
uint256 constant EXP_INVERSE_FP = 0x30644E72E131A029B85045B68181585D97816A916871CA8D3C208C16D87CFD45; // P - 2
uint256 constant EXP_SQRT_FP = 0xC19139CB84C680A6E14116DA060561765E05AA45A1C72A34F082305B61F3F52; // (P + 1) / 4;
// Groth16 alpha point in G1
uint256 constant ALPHA_X = 15279411540481963483749982645131486879260751823620651493692884460296130891713;
uint256 constant ALPHA_Y = 15872895802316430142046488442363778159164596024024981740547841316113839677454;
// Groth16 beta point in G2 in powers of i
uint256 constant BETA_NEG_X_0 = 6145571844528009385227270901181311049451968424667282936975270874464890915386;
uint256 constant BETA_NEG_X_1 = 12771786691609444002416405093387705070206640282801320788762089789398249455552;
uint256 constant BETA_NEG_Y_0 = 4488883874756188982949192438322346627006627895205628031405236004639323835517;
uint256 constant BETA_NEG_Y_1 = 1735169520034591855846686229876971881413094324547255227368057137445726296809;
// Groth16 gamma point in G2 in powers of i
uint256 constant GAMMA_NEG_X_0 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
uint256 constant GAMMA_NEG_X_1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
uint256 constant GAMMA_NEG_Y_0 = 13392588948715843804641432497768002650278120570034223513918757245338268106653;
uint256 constant GAMMA_NEG_Y_1 = 17805874995975841540914202342111839520379459829704422454583296818431106115052;
// Groth16 delta point in G2 in powers of i
uint256 constant DELTA_NEG_X_0 = 10465707362494635227101096813108413078937487707553051407465224907243675430929;
uint256 constant DELTA_NEG_X_1 = 8014260607368773541998918215611927658290278403999176336697043972644519659243;
uint256 constant DELTA_NEG_Y_0 = 19389283139277148919245778864125350153699493315071306268776225113374776030523;
uint256 constant DELTA_NEG_Y_1 = 16335894885742905444968709132584769120387318573561090701871591658625758958113;
// Constant and public input points
uint256 constant CONSTANT_X = 20281192269339458123687070687118212311775320590888414619062163734024177320592;
uint256 constant CONSTANT_Y = 4733327396113282720944079206751955104965328647794767422434462962576999295035;
uint256 constant PUB_0_X = 6933777020392885277709527453058337947310422411038083362275568070104688005311;
uint256 constant PUB_0_Y = 981134475045095331624771061624185350383934842154508663637397442918499383708;
uint256 constant PUB_1_X = 4994703368938944727583784298191985234033403433117347198670233075674015451426;
uint256 constant PUB_1_Y = 8251219283963080431419977720140972699009004688253176317231536639169726973868;
uint256 constant PUB_2_X = 4290838847096051522936899065591427041691227664160185228987863596451823131267;
uint256 constant PUB_2_Y = 20588566735491008722164159313316540988426258906449040460220495569364391658476;
uint256 constant PUB_3_X = 10868099250506113890234768256645470833285719586092080686774540776807380789751;
uint256 constant PUB_3_Y = 481415511937576118656966359026147167555048629225366340770167496559184060449;
uint256 constant PUB_4_X = 248210862999154995000539012177951057105481472135341820587821789934938975214;
uint256 constant PUB_4_Y = 4435539404843896136682123140600986858809597152596796648926707165831171499457;
/// Negation in Fp.
/// @notice Returns a number x such that a + x = 0 in Fp.
/// @notice The input does not need to be reduced.
/// @param a the base
/// @return x the result
function negate(uint256 a) internal pure returns (uint256 x) {
unchecked {
x = (P - (a % P)) % P; // Modulo is cheaper than branching
}
}
/// Exponentiation in Fp.
/// @notice Returns a number x such that a ^ e = x in Fp.
/// @notice The input does not need to be reduced.
/// @param a the base
/// @param e the exponent
/// @return x the result
function exp(uint256 a, uint256 e) internal view returns (uint256 x) {
bool success;
assembly ("memory-safe") {
let f := mload(0x40)
mstore(f, 0x20)
mstore(add(f, 0x20), 0x20)
mstore(add(f, 0x40), 0x20)
mstore(add(f, 0x60), a)
mstore(add(f, 0x80), e)
mstore(add(f, 0xa0), P)
success := staticcall(gas(), PRECOMPILE_MODEXP, f, 0xc0, f, 0x20)
x := mload(f)
}
if (!success) {
// Exponentiation failed.
// Should not happen.
revert ProofInvalid();
}
}
/// Invertsion in Fp.
/// @notice Returns a number x such that a * x = 1 in Fp.
/// @notice The input does not need to be reduced.
/// @notice Reverts with ProofInvalid() if the inverse does not exist
/// @param a the input
/// @return x the solution
function invert_Fp(uint256 a) internal view returns (uint256 x) {
x = exp(a, EXP_INVERSE_FP);
if (mulmod(a, x, P) != 1) {
// Inverse does not exist.
// Can only happen during G2 point decompression.
revert ProofInvalid();
}
}
/// Square root in Fp.
/// @notice Returns a number x such that x * x = a in Fp.
/// @notice Will revert with InvalidProof() if the input is not a square
/// or not reduced.
/// @param a the square
/// @return x the solution
function sqrt_Fp(uint256 a) internal view returns (uint256 x) {
x = exp(a, EXP_SQRT_FP);
if (mulmod(x, x, P) != a) {
// Square root does not exist or a is not reduced.
// Happens when G1 point is not on curve.
revert ProofInvalid();
}
}
/// Square test in Fp.
/// @notice Returns whether a number x exists such that x * x = a in Fp.
/// @notice Will revert with InvalidProof() if the input is not a square
/// or not reduced.
/// @param a the square
/// @return x the solution
function isSquare_Fp(uint256 a) internal view returns (bool) {
uint256 x = exp(a, EXP_SQRT_FP);
return mulmod(x, x, P) == a;
}
/// Square root in Fp2.
/// @notice Fp2 is the complex extension Fp[i]/(i^2 + 1). The input is
/// a0 + a1 ⋅ i and the result is x0 + x1 ⋅ i.
/// @notice Will revert with InvalidProof() if
/// * the input is not a square,
/// * the hint is incorrect, or
/// * the input coefficients are not reduced.
/// @param a0 The real part of the input.
/// @param a1 The imaginary part of the input.
/// @param hint A hint which of two possible signs to pick in the equation.
/// @return x0 The real part of the square root.
/// @return x1 The imaginary part of the square root.
function sqrt_Fp2(uint256 a0, uint256 a1, bool hint) internal view returns (uint256 x0, uint256 x1) {
// If this square root reverts there is no solution in Fp2.
uint256 d = sqrt_Fp(addmod(mulmod(a0, a0, P), mulmod(a1, a1, P), P));
if (hint) {
d = negate(d);
}
// If this square root reverts there is no solution in Fp2.
x0 = sqrt_Fp(mulmod(addmod(a0, d, P), FRACTION_1_2_FP, P));
x1 = mulmod(a1, invert_Fp(mulmod(x0, 2, P)), P);
// Check result to make sure we found a root.
// Note: this also fails if a0 or a1 is not reduced.
if (a0 != addmod(mulmod(x0, x0, P), negate(mulmod(x1, x1, P)), P)
|| a1 != mulmod(2, mulmod(x0, x1, P), P)) {
revert ProofInvalid();
}
}
/// Compress a G1 point.
/// @notice Reverts with InvalidProof if the coordinates are not reduced
/// or if the point is not on the curve.
/// @notice The point at infinity is encoded as (0,0) and compressed to 0.
/// @param x The X coordinate in Fp.
/// @param y The Y coordinate in Fp.
/// @return c The compresed point (x with one signal bit).
function compress_g1(uint256 x, uint256 y) internal view returns (uint256 c) {
if (x >= P || y >= P) {
// G1 point not in field.
revert ProofInvalid();
}
if (x == 0 && y == 0) {
// Point at infinity
return 0;
}
// Note: sqrt_Fp reverts if there is no solution, i.e. the x coordinate is invalid.
uint256 y_pos = sqrt_Fp(addmod(mulmod(mulmod(x, x, P), x, P), 3, P));
if (y == y_pos) {
return (x << 1) | 0;
} else if (y == negate(y_pos)) {
return (x << 1) | 1;
} else {
// G1 point not on curve.
revert ProofInvalid();
}
}
/// Decompress a G1 point.
/// @notice Reverts with InvalidProof if the input does not represent a valid point.
/// @notice The point at infinity is encoded as (0,0) and compressed to 0.
/// @param c The compresed point (x with one signal bit).
/// @return x The X coordinate in Fp.
/// @return y The Y coordinate in Fp.
function decompress_g1(uint256 c) internal view returns (uint256 x, uint256 y) {
// Note that X = 0 is not on the curve since 0³ + 3 = 3 is not a square.
// so we can use it to represent the point at infinity.
if (c == 0) {
// Point at infinity as encoded in EIP196 and EIP197.
return (0, 0);
}
bool negate_point = c & 1 == 1;
x = c >> 1;
if (x >= P) {
// G1 x coordinate not in field.
revert ProofInvalid();
}
// Note: (x³ + 3) is irreducible in Fp, so it can not be zero and therefore
// y can not be zero.
// Note: sqrt_Fp reverts if there is no solution, i.e. the point is not on the curve.
y = sqrt_Fp(addmod(mulmod(mulmod(x, x, P), x, P), 3, P));
if (negate_point) {
y = negate(y);
}
}
/// Compress a G2 point.
/// @notice Reverts with InvalidProof if the coefficients are not reduced
/// or if the point is not on the curve.
/// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1)
/// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i).
/// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0).
/// @param x0 The real part of the X coordinate.
/// @param x1 The imaginary poart of the X coordinate.
/// @param y0 The real part of the Y coordinate.
/// @param y1 The imaginary part of the Y coordinate.
/// @return c0 The first half of the compresed point (x0 with two signal bits).
/// @return c1 The second half of the compressed point (x1 unmodified).
function compress_g2(uint256 x0, uint256 x1, uint256 y0, uint256 y1)
internal view returns (uint256 c0, uint256 c1) {
if (x0 >= P || x1 >= P || y0 >= P || y1 >= P) {
// G2 point not in field.
revert ProofInvalid();
}
if ((x0 | x1 | y0 | y1) == 0) {
// Point at infinity
return (0, 0);
}
// Compute y^2
// Note: shadowing variables and scoping to avoid stack-to-deep.
uint256 y0_pos;
uint256 y1_pos;
{
uint256 n3ab = mulmod(mulmod(x0, x1, P), P-3, P);
uint256 a_3 = mulmod(mulmod(x0, x0, P), x0, P);
uint256 b_3 = mulmod(mulmod(x1, x1, P), x1, P);
y0_pos = addmod(FRACTION_27_82_FP, addmod(a_3, mulmod(n3ab, x1, P), P), P);
y1_pos = negate(addmod(FRACTION_3_82_FP, addmod(b_3, mulmod(n3ab, x0, P), P), P));
}
// Determine hint bit
// If this sqrt fails the x coordinate is not on the curve.
bool hint;
{
uint256 d = sqrt_Fp(addmod(mulmod(y0_pos, y0_pos, P), mulmod(y1_pos, y1_pos, P), P));
hint = !isSquare_Fp(mulmod(addmod(y0_pos, d, P), FRACTION_1_2_FP, P));
}
// Recover y
(y0_pos, y1_pos) = sqrt_Fp2(y0_pos, y1_pos, hint);
if (y0 == y0_pos && y1 == y1_pos) {
c0 = (x0 << 2) | (hint ? 2 : 0) | 0;
c1 = x1;
} else if (y0 == negate(y0_pos) && y1 == negate(y1_pos)) {
c0 = (x0 << 2) | (hint ? 2 : 0) | 1;
c1 = x1;
} else {
// G1 point not on curve.
revert ProofInvalid();
}
}
/// Decompress a G2 point.
/// @notice Reverts with InvalidProof if the input does not represent a valid point.
/// @notice The G2 curve is defined over the complex extension Fp[i]/(i^2 + 1)
/// with coordinates (x0 + x1 ⋅ i, y0 + y1 ⋅ i).
/// @notice The point at infinity is encoded as (0,0,0,0) and compressed to (0,0).
/// @param c0 The first half of the compresed point (x0 with two signal bits).
/// @param c1 The second half of the compressed point (x1 unmodified).
/// @return x0 The real part of the X coordinate.
/// @return x1 The imaginary poart of the X coordinate.
/// @return y0 The real part of the Y coordinate.
/// @return y1 The imaginary part of the Y coordinate.
function decompress_g2(uint256 c0, uint256 c1)
internal view returns (uint256 x0, uint256 x1, uint256 y0, uint256 y1) {
// Note that X = (0, 0) is not on the curve since 0³ + 3/(9 + i) is not a square.
// so we can use it to represent the point at infinity.
if (c0 == 0 && c1 == 0) {
// Point at infinity as encoded in EIP197.
return (0, 0, 0, 0);
}
bool negate_point = c0 & 1 == 1;
bool hint = c0 & 2 == 2;
x0 = c0 >> 2;
x1 = c1;
if (x0 >= P || x1 >= P) {
// G2 x0 or x1 coefficient not in field.
revert ProofInvalid();
}
uint256 n3ab = mulmod(mulmod(x0, x1, P), P-3, P);
uint256 a_3 = mulmod(mulmod(x0, x0, P), x0, P);
uint256 b_3 = mulmod(mulmod(x1, x1, P), x1, P);
y0 = addmod(FRACTION_27_82_FP, addmod(a_3, mulmod(n3ab, x1, P), P), P);
y1 = negate(addmod(FRACTION_3_82_FP, addmod(b_3, mulmod(n3ab, x0, P), P), P));
// Note: sqrt_Fp2 reverts if there is no solution, i.e. the point is not on the curve.
// Note: (X³ + 3/(9 + i)) is irreducible in Fp2, so y can not be zero.
// But y0 or y1 may still independently be zero.
(y0, y1) = sqrt_Fp2(y0, y1, hint);
if (negate_point) {
y0 = negate(y0);
y1 = negate(y1);
}
}
/// Compute the public input linear combination.
/// @notice Reverts with PublicInputNotInField if the input is not in the field.
/// @notice Computes the multi-scalar-multiplication of the public input
/// elements and the verification key including the constant term.
/// @param input The public inputs. These are elements of the scalar field Fr.
/// @return x The X coordinate of the resulting G1 point.
/// @return y The Y coordinate of the resulting G1 point.
function publicInputMSM(uint256[5] calldata input)
internal view returns (uint256 x, uint256 y) {
// Note: The ECMUL precompile does not reject unreduced values, so we check this.
// Note: Unrolling this loop does not cost much extra in code-size, the bulk of the
// code-size is in the PUB_ constants.
// ECMUL has input (x, y, scalar) and output (x', y').
// ECADD has input (x1, y1, x2, y2) and output (x', y').
// We reduce commitments(if any) with constants as the first point argument to ECADD.
// We call them such that ecmul output is already in the second point
// argument to ECADD so we can have a tight loop.
bool success = true;
assembly ("memory-safe") {
let f := mload(0x40)
let g := add(f, 0x40)
let s
mstore(f, CONSTANT_X)
mstore(add(f, 0x20), CONSTANT_Y)
mstore(g, PUB_0_X)
mstore(add(g, 0x20), PUB_0_Y)
s := calldataload(input)
mstore(add(g, 0x40), s)
success := and(success, lt(s, R))
success := and(success, staticcall(gas(), PRECOMPILE_MUL, g, 0x60, g, 0x40))
success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40))
mstore(g, PUB_1_X)
mstore(add(g, 0x20), PUB_1_Y)
s := calldataload(add(input, 32))
mstore(add(g, 0x40), s)
success := and(success, lt(s, R))
success := and(success, staticcall(gas(), PRECOMPILE_MUL, g, 0x60, g, 0x40))
success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40))
mstore(g, PUB_2_X)
mstore(add(g, 0x20), PUB_2_Y)
s := calldataload(add(input, 64))
mstore(add(g, 0x40), s)
success := and(success, lt(s, R))
success := and(success, staticcall(gas(), PRECOMPILE_MUL, g, 0x60, g, 0x40))
success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40))
mstore(g, PUB_3_X)
mstore(add(g, 0x20), PUB_3_Y)
s := calldataload(add(input, 96))
mstore(add(g, 0x40), s)
success := and(success, lt(s, R))
success := and(success, staticcall(gas(), PRECOMPILE_MUL, g, 0x60, g, 0x40))
success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40))
mstore(g, PUB_4_X)
mstore(add(g, 0x20), PUB_4_Y)
s := calldataload(add(input, 128))
mstore(add(g, 0x40), s)
success := and(success, lt(s, R))
success := and(success, staticcall(gas(), PRECOMPILE_MUL, g, 0x60, g, 0x40))
success := and(success, staticcall(gas(), PRECOMPILE_ADD, f, 0x80, f, 0x40))
x := mload(f)
y := mload(add(f, 0x20))
}
if (!success) {
// Either Public input not in field, or verification key invalid.
// We assume the contract is correctly generated, so the verification key is valid.
revert PublicInputNotInField();
}
}
/// Compress a proof.
/// @notice Will revert with InvalidProof if the curve points are invalid,
/// but does not verify the proof itself.
/// @param proof The uncompressed Groth16 proof. Elements are in the same order as for
/// verifyProof. I.e. Groth16 points (A, B, C) encoded as in EIP-197.
/// @return compressed The compressed proof. Elements are in the same order as for
/// verifyCompressedProof. I.e. points (A, B, C) in compressed format.
function compressProof(uint256[8] calldata proof)
public view returns (uint256[4] memory compressed) {
compressed[0] = compress_g1(proof[0], proof[1]);
(compressed[2], compressed[1]) = compress_g2(proof[3], proof[2], proof[5], proof[4]);
compressed[3] = compress_g1(proof[6], proof[7]);
}
/// Verify a Groth16 proof with compressed points.
/// @notice Reverts with InvalidProof if the proof is invalid or
/// with PublicInputNotInField the public input is not reduced.
/// @notice There is no return value. If the function does not revert, the
/// proof was successfully verified.
/// @param compressedProof the points (A, B, C) in compressed format
/// matching the output of compressProof.
/// @param input the public input field elements in the scalar field Fr.
/// Elements must be reduced.
function verifyCompressedProof(
uint256[4] calldata compressedProof,
uint256[5] calldata input
) public view {
uint256[24] memory pairings;
{
(uint256 Ax, uint256 Ay) = decompress_g1(compressedProof[0]);
(uint256 Bx0, uint256 Bx1, uint256 By0, uint256 By1) = decompress_g2(compressedProof[2], compressedProof[1]);
(uint256 Cx, uint256 Cy) = decompress_g1(compressedProof[3]);
(uint256 Lx, uint256 Ly) = publicInputMSM(input);
// Verify the pairing
// Note: The precompile expects the F2 coefficients in big-endian order.
// Note: The pairing precompile rejects unreduced values, so we won't check that here.
// e(A, B)
pairings[ 0] = Ax;
pairings[ 1] = Ay;
pairings[ 2] = Bx1;
pairings[ 3] = Bx0;
pairings[ 4] = By1;
pairings[ 5] = By0;
// e(C, -δ)
pairings[ 6] = Cx;
pairings[ 7] = Cy;
pairings[ 8] = DELTA_NEG_X_1;
pairings[ 9] = DELTA_NEG_X_0;
pairings[10] = DELTA_NEG_Y_1;
pairings[11] = DELTA_NEG_Y_0;
// e(α, -β)
pairings[12] = ALPHA_X;
pairings[13] = ALPHA_Y;
pairings[14] = BETA_NEG_X_1;
pairings[15] = BETA_NEG_X_0;
pairings[16] = BETA_NEG_Y_1;
pairings[17] = BETA_NEG_Y_0;
// e(L_pub, -γ)
pairings[18] = Lx;
pairings[19] = Ly;
pairings[20] = GAMMA_NEG_X_1;
pairings[21] = GAMMA_NEG_X_0;
pairings[22] = GAMMA_NEG_Y_1;
pairings[23] = GAMMA_NEG_Y_0;
// Check pairing equation.
bool success;
uint256[1] memory output;
assembly ("memory-safe") {
success := staticcall(gas(), PRECOMPILE_VERIFY, pairings, 0x300, output, 0x20)
}
if (!success || output[0] != 1) {
// Either proof or verification key invalid.
// We assume the contract is correctly generated, so the verification key is valid.
revert ProofInvalid();
}
}
}
/// Verify an uncompressed Groth16 proof.
/// @notice Reverts with InvalidProof if the proof is invalid or
/// with PublicInputNotInField the public input is not reduced.
/// @notice There is no return value. If the function does not revert, the
/// proof was successfully verified.
/// @param proof the points (A, B, C) in EIP-197 format matching the output
/// of compressProof.
/// @param input the public input field elements in the scalar field Fr.
/// Elements must be reduced.
function verifyProof(
uint256[8] calldata proof,
uint256[5] calldata input
) public view {
(uint256 x, uint256 y) = publicInputMSM(input);
// Note: The precompile expects the F2 coefficients in big-endian order.
// Note: The pairing precompile rejects unreduced values, so we won't check that here.
bool success;
assembly ("memory-safe") {
let f := mload(0x40) // Free memory pointer.
// Copy points (A, B, C) to memory. They are already in correct encoding.
// This is pairing e(A, B) and G1 of e(C, -δ).
calldatacopy(f, proof, 0x100)
// Complete e(C, -δ) and write e(α, -β), e(L_pub, -γ) to memory.
// OPT: This could be better done using a single codecopy, but
// Solidity (unlike standalone Yul) doesn't provide a way to
// to do this.
mstore(add(f, 0x100), DELTA_NEG_X_1)
mstore(add(f, 0x120), DELTA_NEG_X_0)
mstore(add(f, 0x140), DELTA_NEG_Y_1)
mstore(add(f, 0x160), DELTA_NEG_Y_0)
mstore(add(f, 0x180), ALPHA_X)
mstore(add(f, 0x1a0), ALPHA_Y)
mstore(add(f, 0x1c0), BETA_NEG_X_1)
mstore(add(f, 0x1e0), BETA_NEG_X_0)
mstore(add(f, 0x200), BETA_NEG_Y_1)
mstore(add(f, 0x220), BETA_NEG_Y_0)
mstore(add(f, 0x240), x)
mstore(add(f, 0x260), y)
mstore(add(f, 0x280), GAMMA_NEG_X_1)
mstore(add(f, 0x2a0), GAMMA_NEG_X_0)
mstore(add(f, 0x2c0), GAMMA_NEG_Y_1)
mstore(add(f, 0x2e0), GAMMA_NEG_Y_0)
// Check pairing equation.
success := staticcall(gas(), PRECOMPILE_VERIFY, f, 0x300, f, 0x20)
// Also check returned value (both are either 1 or 0).
success := and(success, mload(f))
}
if (!success) {
// Either proof or verification key invalid.
// We assume the contract is correctly generated, so the verification key is valid.
revert ProofInvalid();
}
}
}
Compiler Settings
{"viaIR":false,"remappings":["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","forge-std/=lib/forge-std/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"none","appendCBOR":false},"libraries":{},"evmVersion":"shanghai"}
Contract ABI
[{"type":"error","name":"InvalidExitCode","inputs":[]},{"type":"error","name":"InvalidProof","inputs":[]},{"type":"error","name":"InvalidVkRoot","inputs":[]},{"type":"error","name":"ProofInvalid","inputs":[]},{"type":"error","name":"PublicInputNotInField","inputs":[]},{"type":"error","name":"WrongVerifierSelector","inputs":[{"type":"bytes4","name":"received","internalType":"bytes4"},{"type":"bytes4","name":"expected","internalType":"bytes4"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"VERIFIER_HASH","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"VERSION","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"VK_ROOT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[4]","name":"compressed","internalType":"uint256[4]"}],"name":"compressProof","inputs":[{"type":"uint256[8]","name":"proof","internalType":"uint256[8]"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"hashPublicValues","inputs":[{"type":"bytes","name":"publicValues","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[],"name":"verifyCompressedProof","inputs":[{"type":"uint256[4]","name":"compressedProof","internalType":"uint256[4]"},{"type":"uint256[5]","name":"input","internalType":"uint256[5]"}]},{"type":"function","stateMutability":"view","outputs":[],"name":"verifyProof","inputs":[{"type":"uint256[8]","name":"proof","internalType":"uint256[8]"},{"type":"uint256[5]","name":"input","internalType":"uint256[5]"}]},{"type":"function","stateMutability":"view","outputs":[],"name":"verifyProof","inputs":[{"type":"bytes32","name":"programVKey","internalType":"bytes32"},{"type":"bytes","name":"publicValues","internalType":"bytes"},{"type":"bytes","name":"proofBytes","internalType":"bytes"}]}]
Contract Creation Code
0x6080604052348015600e575f5ffd5b50611a298061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80636b61d8e7116100585780636b61d8e7146101065780637cad4e1314610119578063a67086041461013e578063ffa1ad7414610151575f5ffd5b80632a07d99a146100895780632a5104361461009e57806341493c60146100d357806344f63692146100e6575b5f5ffd5b61009c610097366004611621565b610179565b005b7f4388a21c687fdd5f218d7e3d13190cac4c5355818d3605fd5fb811df468ee6965b6040519081526020015b60405180910390f35b61009c6100e136600461169b565b6103f7565b6100f96100f4366004611714565b610594565b6040516100ca9190611736565b6100c0610114366004611766565b6105f1565b7e2f850ee998974d6cc00e50cd0814b098c05bfade466d28573240d057f253526100c0565b61009c61014c3660046117a5565b610656565b6040805180820182526006815265076362e312e360d41b602082015290516100ca91906117de565b5f5f61018483610970565b915091505f6040516101008682377f11b7e9276171bb0efd647fc63e38bbfba3076f20daca8cd52bcc7284d9b1c6eb6101008201527f1723616533dd6ae53502c9c506a81f23f543d68750b5133ebfbe1f4746b3b0116101208201527f241dc9f1df2ecb0c7e6d9522e0d83fe29cb5f4af6571c91c49ea04640c0492216101408201527f2addf202c6b971af36fbafa29888d52e2d13e3e95ea7513d6436f0c1f256f53b6101608201527f21c7d728a5fd961fc179ec5eab938f564deba5b271e1c90c2c29a79648418fc16101808201527f2317bd9b644830ef5ffec1c2d46b5442aa8029d41eb58fb8fc939fb03365e00e6101a08201527f1c3c9339849225980c7d3f824f80d19e2a9c2554b6ab2160fa9635528f693fc06101c08201527f0d964538da2653f2e62499571e6c78afb8909d3ea8107f306bd6928253680a3a6101e08201527f03d612368fddb0f3f83497dbc0ae760f98978cff3af02fdee725fb3562839ae96102008201527f09ec9e44c7989c61a534b716d1d6db028893c68a9934b17f3a50af2e56d1cc7d61022082015283610240820152826102608201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26102808201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6102a08201527f275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec6102c08201527f1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d6102e08201526020816103008360085afa9051169050806103f057604051631ff3747d60e21b815260040160405180910390fd5b5050505050565b5f6104056004828486611829565b61040e91611850565b90507f4388a21c687fdd5f218d7e3d13190cac4c5355818d3605fd5fb811df468ee6966310e2288760e21b6001600160e01b031983161461047a5760405163988066a160e01b81526001600160e01b031980841660048301528216602482015260440160405180910390fd5b7e2f850ee998974d6cc00e50cd0814b098c05bfade466d28573240d057f253525f6104a588886105f1565b90505f8080806104b8896004818d611829565b8101906104c5919061189a565b93509350935093506104d5611587565b8d815260208101869052604081018590526060810184905260808101839052841561051357604051631fcf917760e01b815260040160405180910390fd5b86841461053357604051631ab15d8b60e31b815260040160405180910390fd5b604051631503eccd60e11b81523090632a07d99a906105589085908590600401611933565b5f6040518083038186803b15801561056e575f5ffd5b505afa158015610580573d5f5f3e3d5ffd5b505050505050505050505050505050505050565b61059c6115a5565b6105af82358360015b6020020135610c91565b81526105cd6060830135604084013560a08501356080860135610d7d565b602083015260408201526105e760c08301358360076105a5565b6060820152919050565b5f6001600160fd1b035f1b6002848460405161060e92919061198f565b602060405180830381855afa158015610629573d5f5f3e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061064c919061199e565b1690505b92915050565b61065e6115c3565b5f8061067085825b6020020135611056565b90925090505f80808061068b60408a013560208b01356110f4565b929650909450925090505f806106a28b6003610666565b915091505f5f6106b18c610970565b8b8d5260208d018b905260408d0189905260608d018a905260808d0187905260a08d0188905260c08d0186905260e08d018590527f11b7e9276171bb0efd647fc63e38bbfba3076f20daca8cd52bcc7284d9b1c6eb6101008e01527f1723616533dd6ae53502c9c506a81f23f543d68750b5133ebfbe1f4746b3b0116101208e01527f241dc9f1df2ecb0c7e6d9522e0d83fe29cb5f4af6571c91c49ea04640c0492216101408e01527f2addf202c6b971af36fbafa29888d52e2d13e3e95ea7513d6436f0c1f256f53b6101608e01527f21c7d728a5fd961fc179ec5eab938f564deba5b271e1c90c2c29a79648418fc16101808e01527f2317bd9b644830ef5ffec1c2d46b5442aa8029d41eb58fb8fc939fb03365e00e6101a08e01527f1c3c9339849225980c7d3f824f80d19e2a9c2554b6ab2160fa9635528f693fc06101c08e01527f0d964538da2653f2e62499571e6c78afb8909d3ea8107f306bd6928253680a3a6101e08e01527f03d612368fddb0f3f83497dbc0ae760f98978cff3af02fdee725fb3562839ae96102008e01527f09ec9e44c7989c61a534b716d1d6db028893c68a9934b17f3a50af2e56d1cc7d6102208e01526102408d018290526102608d018190527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26102808e01527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6102a08e01527f275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec6102c08e01527f1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d6102e08e015290925090505f6109256115e2565b6020816103008f60085afa915081158061094157508051600114155b1561095f57604051631ff3747d60e21b815260040160405180910390fd5b505050505050505050505050505050565b5f5f5f60019050604051604081015f7f2cd6bf7f164af0b6b0bbbe0fdcb06ee0c1ba07f8e6eb2f9f3943a90cb1d4029083527f0a76f7e6e8a78d71649eb7e3132018885e2f57ccca64394738e746c63c9fa83b60208401527f0f5460f3b7221705435e745da21e276536379c0113c13c4255e7ae101f1e90bf82527f022b4d6c4b7dbdeed528d5abe6eddd6f2bd4ae4b9b0450dc18901fc727da799c6020830152863590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa841693507f0b0ae6e491bc04c544da9e8cd4857d201b4cfa0222dbe96aac97f044fdf1c92282527f123e064d2ffdb7f8094b727cde1c0beea6d4d551e5743a336804f8effb7f07ac6020830152602087013590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa841693507f097c875a6ebd0999b06e7267ff3d8a6bf859bb9635abae07cb6b3534ba409a8382527f2d84b73fb0f397e356b524f2d0e9ddc9d0f6ac75e566041147ee8554879183ec6020830152604087013590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa841693507f1807204ddcd27506ba72e17b55227b0bf310136ecb40c74acd52f3ccfbcba9f782527f011078b5c7767fe73bb54241dcd143ee805ea4383d48d46bced129482c8c20216020830152606087013590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa7e8c7b7c98d78c07a2c4be5f6be7082ba41021611f9a2dfc016f8bbb37d36bee83527f09ce6d246baeac24b5a404ca175c2cc4a974e217176fe2ec2a6c22eb60fd65c16020840152608088013560408085018290525f516020611a095f395f51905f5290911091909516169390508160608160075afa831692505060408160808360065afa81516020909201519194509092501680610c8b5760405163a54f8e2760e01b815260040160405180910390fd5b50915091565b5f5f5160206119e95f395f51905f5283101580610cbb57505f5160206119e95f395f51905f528210155b15610cd957604051631ff3747d60e21b815260040160405180910390fd5b82158015610ce5575081155b15610cf157505f610650565b5f610d2c5f5160206119e95f395f51905f5260035f5160206119e95f395f51905f52875f5160206119e95f395f51905f52898a0909086112c8565b9050808303610d41575050600182901b610650565b610d4a8161132a565b8303610d5d575050600182811b17610650565b604051631ff3747d60e21b815260040160405180910390fd5b5092915050565b5f5f5f5160206119e95f395f51905f5286101580610da857505f5160206119e95f395f51905f528510155b80610dc057505f5160206119e95f395f51905f528410155b80610dd857505f5160206119e95f395f51905f528310155b15610df657604051631ff3747d60e21b815260040160405180910390fd5b828486881717175f03610e0d57505f90508061104d565b5f80805f5160206119e95f395f51905f52610e3660035f5160206119e95f395f51905f526119c9565b5f5160206119e95f395f51905f528a8c090990505f5f5160206119e95f395f51905f528a5f5160206119e95f395f51905f528c8d090990505f5f5160206119e95f395f51905f528a5f5160206119e95f395f51905f528c8d090990505f5160206119e95f395f51905f52805f5160206119e95f395f51905f528c860984087f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5089450610f245f5160206119e95f395f51905f52805f5160206119e95f395f51905f528e870984087f2fcd3ac2a640a154eb23960892a85a68f031ca0c8344b23a577dcf1052b9e7750861132a565b93505050505f5f610f715f5160206119e95f395f51905f5280610f4957610f496119b5565b5f5160206119e95f395f51905f528586095f5160206119e95f395f51905f52878809086112c8565b9050610fbc5f5160206119e95f395f51905f527f183227397098d014dc2822db40c0ac2ecbc0b548b438e5469e10460b6c3e7ea45f5160206119e95f395f51905f5284880809611342565b15915050610fcb83838361138a565b90935091508683148015610fde57508186145b156110065780610fee575f610ff1565b60025b60ff1660028a901b175f179450879350611049565b61100f8361132a565b8714801561102457506110218261132a565b86145b15610d5d5780611034575f611037565b60025b60ff1660028a901b1760011794508793505b5050505b94509492505050565b5f5f825f0361106957505f928392509050565b600183811c9250808416145f5160206119e95f395f51905f5283106110a157604051631ff3747d60e21b815260040160405180910390fd5b6110db5f5160206119e95f395f51905f5260035f5160206119e95f395f51905f52865f5160206119e95f395f51905f5288890909086112c8565b91508015610c8b576110ec8261132a565b915050915091565b5f80808085158015611104575084155b1561111957505f9250829150819050806112bf565b600286811c945085935060018088161490808816145f5160206119e95f395f51905f528610158061115757505f5160206119e95f395f51905f528510155b1561117557604051631ff3747d60e21b815260040160405180910390fd5b5f5f5160206119e95f395f51905f5261119c60035f5160206119e95f395f51905f526119c9565b5f5160206119e95f395f51905f52888a090990505f5f5160206119e95f395f51905f52885f5160206119e95f395f51905f528a8b090990505f5f5160206119e95f395f51905f52885f5160206119e95f395f51905f528a8b090990505f5160206119e95f395f51905f52805f5160206119e95f395f51905f528a860984087f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e508965061128a5f5160206119e95f395f51905f52805f5160206119e95f395f51905f528c870984087f2fcd3ac2a640a154eb23960892a85a68f031ca0c8344b23a577dcf1052b9e7750861132a565b955061129787878661138a565b909750955084156112b9576112ab8761132a565b96506112b68661132a565b95505b50505050505b92959194509250565b5f6112f3827f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f526114c6565b9050815f5160206119e95f395f51905f528283091461132557604051631ff3747d60e21b815260040160405180910390fd5b919050565b5f5160206119e95f395f51905f529081900681030690565b5f5f61136e837f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f526114c6565b9050825f5160206119e95f395f51905f52828309149392505050565b5f80806113b95f5160206119e95f395f51905f52808788095f5160206119e95f395f51905f52898a09086112c8565b905083156113cd576113ca8161132a565b90505b6114165f5160206119e95f395f51905f527f183227397098d014dc2822db40c0ac2ecbc0b548b438e5469e10460b6c3e7ea45f5160206119e95f395f51905f52848a08096112c8565b92505f5160206119e95f395f51905f526114405f5160206119e95f395f51905f5260028609611529565b860991505f5160206119e95f395f51905f5261146b5f5160206119e95f395f51905f5284850961132a565b5f5160206119e95f395f51905f52858609088614158061149f57505f5160206119e95f395f51905f52808385096002098514155b156114bd57604051631ff3747d60e21b815260040160405180910390fd5b50935093915050565b5f5f60405160208152602080820152602060408201528460608201528360808201525f5160206119e95f395f51905f5260a082015260208160c08360055afa90519250905080610d7657604051631ff3747d60e21b815260040160405180910390fd5b5f611554827f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd456114c6565b90505f5160206119e95f395f51905f5281830960011461132557604051631ff3747d60e21b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061030001604052806018906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b806101008101831015610650575f5ffd5b8060a08101831015610650575f5ffd5b5f5f6101a08385031215611633575f5ffd5b61163d8484611600565b915061164d846101008501611611565b90509250929050565b5f5f83601f840112611666575f5ffd5b50813567ffffffffffffffff81111561167d575f5ffd5b602083019150836020828501011115611694575f5ffd5b9250929050565b5f5f5f5f5f606086880312156116af575f5ffd5b85359450602086013567ffffffffffffffff8111156116cc575f5ffd5b6116d888828901611656565b909550935050604086013567ffffffffffffffff8111156116f7575f5ffd5b61170388828901611656565b969995985093965092949392505050565b5f6101008284031215611725575f5ffd5b61172f8383611600565b9392505050565b6080810181835f5b600481101561175d57815183526020928301929091019060010161173e565b50505092915050565b5f5f60208385031215611777575f5ffd5b823567ffffffffffffffff81111561178d575f5ffd5b61179985828601611656565b90969095509350505050565b5f5f61012083850312156117b7575f5ffd5b60808301848111156117c7575f5ffd5b8392506117d48582611611565b9150509250929050565b602081525f82518060208401525f5b8181101561180a57602081860181015160408684010152016117ed565b505f604082850101526040601f19601f83011684010191505092915050565b5f5f85851115611837575f5ffd5b83861115611843575f5ffd5b5050820193919092039150565b80356001600160e01b03198116906004841015610d76576001600160e01b031960049490940360031b84901b1690921692915050565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f5f61016085870312156118ae575f5ffd5b843593506020850135925060408501359150607f850186136118ce575f5ffd5b604051610100810181811067ffffffffffffffff821117156118f2576118f2611886565b60405280610160870188811115611907575f5ffd5b606088015b8181101561192457803583526020928301920161190c565b50959894975092955093505050565b6101a0810181845f5b600881101561195b57815183526020928301929091019060010161193c565b5050506101008201835f5b6005811015611985578151835260209283019290910190600101611966565b5050509392505050565b818382375f9101908152919050565b5f602082840312156119ae575f5ffd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b8181038181111561065057634e487b7160e01b5f52601160045260245ffdfe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4730644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001
Deployed ByteCode
0x608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80636b61d8e7116100585780636b61d8e7146101065780637cad4e1314610119578063a67086041461013e578063ffa1ad7414610151575f5ffd5b80632a07d99a146100895780632a5104361461009e57806341493c60146100d357806344f63692146100e6575b5f5ffd5b61009c610097366004611621565b610179565b005b7f4388a21c687fdd5f218d7e3d13190cac4c5355818d3605fd5fb811df468ee6965b6040519081526020015b60405180910390f35b61009c6100e136600461169b565b6103f7565b6100f96100f4366004611714565b610594565b6040516100ca9190611736565b6100c0610114366004611766565b6105f1565b7e2f850ee998974d6cc00e50cd0814b098c05bfade466d28573240d057f253526100c0565b61009c61014c3660046117a5565b610656565b6040805180820182526006815265076362e312e360d41b602082015290516100ca91906117de565b5f5f61018483610970565b915091505f6040516101008682377f11b7e9276171bb0efd647fc63e38bbfba3076f20daca8cd52bcc7284d9b1c6eb6101008201527f1723616533dd6ae53502c9c506a81f23f543d68750b5133ebfbe1f4746b3b0116101208201527f241dc9f1df2ecb0c7e6d9522e0d83fe29cb5f4af6571c91c49ea04640c0492216101408201527f2addf202c6b971af36fbafa29888d52e2d13e3e95ea7513d6436f0c1f256f53b6101608201527f21c7d728a5fd961fc179ec5eab938f564deba5b271e1c90c2c29a79648418fc16101808201527f2317bd9b644830ef5ffec1c2d46b5442aa8029d41eb58fb8fc939fb03365e00e6101a08201527f1c3c9339849225980c7d3f824f80d19e2a9c2554b6ab2160fa9635528f693fc06101c08201527f0d964538da2653f2e62499571e6c78afb8909d3ea8107f306bd6928253680a3a6101e08201527f03d612368fddb0f3f83497dbc0ae760f98978cff3af02fdee725fb3562839ae96102008201527f09ec9e44c7989c61a534b716d1d6db028893c68a9934b17f3a50af2e56d1cc7d61022082015283610240820152826102608201527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26102808201527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6102a08201527f275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec6102c08201527f1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d6102e08201526020816103008360085afa9051169050806103f057604051631ff3747d60e21b815260040160405180910390fd5b5050505050565b5f6104056004828486611829565b61040e91611850565b90507f4388a21c687fdd5f218d7e3d13190cac4c5355818d3605fd5fb811df468ee6966310e2288760e21b6001600160e01b031983161461047a5760405163988066a160e01b81526001600160e01b031980841660048301528216602482015260440160405180910390fd5b7e2f850ee998974d6cc00e50cd0814b098c05bfade466d28573240d057f253525f6104a588886105f1565b90505f8080806104b8896004818d611829565b8101906104c5919061189a565b93509350935093506104d5611587565b8d815260208101869052604081018590526060810184905260808101839052841561051357604051631fcf917760e01b815260040160405180910390fd5b86841461053357604051631ab15d8b60e31b815260040160405180910390fd5b604051631503eccd60e11b81523090632a07d99a906105589085908590600401611933565b5f6040518083038186803b15801561056e575f5ffd5b505afa158015610580573d5f5f3e3d5ffd5b505050505050505050505050505050505050565b61059c6115a5565b6105af82358360015b6020020135610c91565b81526105cd6060830135604084013560a08501356080860135610d7d565b602083015260408201526105e760c08301358360076105a5565b6060820152919050565b5f6001600160fd1b035f1b6002848460405161060e92919061198f565b602060405180830381855afa158015610629573d5f5f3e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061064c919061199e565b1690505b92915050565b61065e6115c3565b5f8061067085825b6020020135611056565b90925090505f80808061068b60408a013560208b01356110f4565b929650909450925090505f806106a28b6003610666565b915091505f5f6106b18c610970565b8b8d5260208d018b905260408d0189905260608d018a905260808d0187905260a08d0188905260c08d0186905260e08d018590527f11b7e9276171bb0efd647fc63e38bbfba3076f20daca8cd52bcc7284d9b1c6eb6101008e01527f1723616533dd6ae53502c9c506a81f23f543d68750b5133ebfbe1f4746b3b0116101208e01527f241dc9f1df2ecb0c7e6d9522e0d83fe29cb5f4af6571c91c49ea04640c0492216101408e01527f2addf202c6b971af36fbafa29888d52e2d13e3e95ea7513d6436f0c1f256f53b6101608e01527f21c7d728a5fd961fc179ec5eab938f564deba5b271e1c90c2c29a79648418fc16101808e01527f2317bd9b644830ef5ffec1c2d46b5442aa8029d41eb58fb8fc939fb03365e00e6101a08e01527f1c3c9339849225980c7d3f824f80d19e2a9c2554b6ab2160fa9635528f693fc06101c08e01527f0d964538da2653f2e62499571e6c78afb8909d3ea8107f306bd6928253680a3a6101e08e01527f03d612368fddb0f3f83497dbc0ae760f98978cff3af02fdee725fb3562839ae96102008e01527f09ec9e44c7989c61a534b716d1d6db028893c68a9934b17f3a50af2e56d1cc7d6102208e01526102408d018290526102608d018190527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c26102808e01527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6102a08e01527f275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec6102c08e01527f1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d6102e08e015290925090505f6109256115e2565b6020816103008f60085afa915081158061094157508051600114155b1561095f57604051631ff3747d60e21b815260040160405180910390fd5b505050505050505050505050505050565b5f5f5f60019050604051604081015f7f2cd6bf7f164af0b6b0bbbe0fdcb06ee0c1ba07f8e6eb2f9f3943a90cb1d4029083527f0a76f7e6e8a78d71649eb7e3132018885e2f57ccca64394738e746c63c9fa83b60208401527f0f5460f3b7221705435e745da21e276536379c0113c13c4255e7ae101f1e90bf82527f022b4d6c4b7dbdeed528d5abe6eddd6f2bd4ae4b9b0450dc18901fc727da799c6020830152863590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa841693507f0b0ae6e491bc04c544da9e8cd4857d201b4cfa0222dbe96aac97f044fdf1c92282527f123e064d2ffdb7f8094b727cde1c0beea6d4d551e5743a336804f8effb7f07ac6020830152602087013590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa841693507f097c875a6ebd0999b06e7267ff3d8a6bf859bb9635abae07cb6b3534ba409a8382527f2d84b73fb0f397e356b524f2d0e9ddc9d0f6ac75e566041147ee8554879183ec6020830152604087013590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa841693507f1807204ddcd27506ba72e17b55227b0bf310136ecb40c74acd52f3ccfbcba9f782527f011078b5c7767fe73bb54241dcd143ee805ea4383d48d46bced129482c8c20216020830152606087013590508060408301525f516020611a095f395f51905f5281108416935060408260608460075afa8416935060408360808560065afa7e8c7b7c98d78c07a2c4be5f6be7082ba41021611f9a2dfc016f8bbb37d36bee83527f09ce6d246baeac24b5a404ca175c2cc4a974e217176fe2ec2a6c22eb60fd65c16020840152608088013560408085018290525f516020611a095f395f51905f5290911091909516169390508160608160075afa831692505060408160808360065afa81516020909201519194509092501680610c8b5760405163a54f8e2760e01b815260040160405180910390fd5b50915091565b5f5f5160206119e95f395f51905f5283101580610cbb57505f5160206119e95f395f51905f528210155b15610cd957604051631ff3747d60e21b815260040160405180910390fd5b82158015610ce5575081155b15610cf157505f610650565b5f610d2c5f5160206119e95f395f51905f5260035f5160206119e95f395f51905f52875f5160206119e95f395f51905f52898a0909086112c8565b9050808303610d41575050600182901b610650565b610d4a8161132a565b8303610d5d575050600182811b17610650565b604051631ff3747d60e21b815260040160405180910390fd5b5092915050565b5f5f5f5160206119e95f395f51905f5286101580610da857505f5160206119e95f395f51905f528510155b80610dc057505f5160206119e95f395f51905f528410155b80610dd857505f5160206119e95f395f51905f528310155b15610df657604051631ff3747d60e21b815260040160405180910390fd5b828486881717175f03610e0d57505f90508061104d565b5f80805f5160206119e95f395f51905f52610e3660035f5160206119e95f395f51905f526119c9565b5f5160206119e95f395f51905f528a8c090990505f5f5160206119e95f395f51905f528a5f5160206119e95f395f51905f528c8d090990505f5f5160206119e95f395f51905f528a5f5160206119e95f395f51905f528c8d090990505f5160206119e95f395f51905f52805f5160206119e95f395f51905f528c860984087f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e5089450610f245f5160206119e95f395f51905f52805f5160206119e95f395f51905f528e870984087f2fcd3ac2a640a154eb23960892a85a68f031ca0c8344b23a577dcf1052b9e7750861132a565b93505050505f5f610f715f5160206119e95f395f51905f5280610f4957610f496119b5565b5f5160206119e95f395f51905f528586095f5160206119e95f395f51905f52878809086112c8565b9050610fbc5f5160206119e95f395f51905f527f183227397098d014dc2822db40c0ac2ecbc0b548b438e5469e10460b6c3e7ea45f5160206119e95f395f51905f5284880809611342565b15915050610fcb83838361138a565b90935091508683148015610fde57508186145b156110065780610fee575f610ff1565b60025b60ff1660028a901b175f179450879350611049565b61100f8361132a565b8714801561102457506110218261132a565b86145b15610d5d5780611034575f611037565b60025b60ff1660028a901b1760011794508793505b5050505b94509492505050565b5f5f825f0361106957505f928392509050565b600183811c9250808416145f5160206119e95f395f51905f5283106110a157604051631ff3747d60e21b815260040160405180910390fd5b6110db5f5160206119e95f395f51905f5260035f5160206119e95f395f51905f52865f5160206119e95f395f51905f5288890909086112c8565b91508015610c8b576110ec8261132a565b915050915091565b5f80808085158015611104575084155b1561111957505f9250829150819050806112bf565b600286811c945085935060018088161490808816145f5160206119e95f395f51905f528610158061115757505f5160206119e95f395f51905f528510155b1561117557604051631ff3747d60e21b815260040160405180910390fd5b5f5f5160206119e95f395f51905f5261119c60035f5160206119e95f395f51905f526119c9565b5f5160206119e95f395f51905f52888a090990505f5f5160206119e95f395f51905f52885f5160206119e95f395f51905f528a8b090990505f5f5160206119e95f395f51905f52885f5160206119e95f395f51905f528a8b090990505f5160206119e95f395f51905f52805f5160206119e95f395f51905f528a860984087f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e508965061128a5f5160206119e95f395f51905f52805f5160206119e95f395f51905f528c870984087f2fcd3ac2a640a154eb23960892a85a68f031ca0c8344b23a577dcf1052b9e7750861132a565b955061129787878661138a565b909750955084156112b9576112ab8761132a565b96506112b68661132a565b95505b50505050505b92959194509250565b5f6112f3827f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f526114c6565b9050815f5160206119e95f395f51905f528283091461132557604051631ff3747d60e21b815260040160405180910390fd5b919050565b5f5160206119e95f395f51905f529081900681030690565b5f5f61136e837f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f526114c6565b9050825f5160206119e95f395f51905f52828309149392505050565b5f80806113b95f5160206119e95f395f51905f52808788095f5160206119e95f395f51905f52898a09086112c8565b905083156113cd576113ca8161132a565b90505b6114165f5160206119e95f395f51905f527f183227397098d014dc2822db40c0ac2ecbc0b548b438e5469e10460b6c3e7ea45f5160206119e95f395f51905f52848a08096112c8565b92505f5160206119e95f395f51905f526114405f5160206119e95f395f51905f5260028609611529565b860991505f5160206119e95f395f51905f5261146b5f5160206119e95f395f51905f5284850961132a565b5f5160206119e95f395f51905f52858609088614158061149f57505f5160206119e95f395f51905f52808385096002098514155b156114bd57604051631ff3747d60e21b815260040160405180910390fd5b50935093915050565b5f5f60405160208152602080820152602060408201528460608201528360808201525f5160206119e95f395f51905f5260a082015260208160c08360055afa90519250905080610d7657604051631ff3747d60e21b815260040160405180910390fd5b5f611554827f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd456114c6565b90505f5160206119e95f395f51905f5281830960011461132557604051631ff3747d60e21b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061030001604052806018906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b806101008101831015610650575f5ffd5b8060a08101831015610650575f5ffd5b5f5f6101a08385031215611633575f5ffd5b61163d8484611600565b915061164d846101008501611611565b90509250929050565b5f5f83601f840112611666575f5ffd5b50813567ffffffffffffffff81111561167d575f5ffd5b602083019150836020828501011115611694575f5ffd5b9250929050565b5f5f5f5f5f606086880312156116af575f5ffd5b85359450602086013567ffffffffffffffff8111156116cc575f5ffd5b6116d888828901611656565b909550935050604086013567ffffffffffffffff8111156116f7575f5ffd5b61170388828901611656565b969995985093965092949392505050565b5f6101008284031215611725575f5ffd5b61172f8383611600565b9392505050565b6080810181835f5b600481101561175d57815183526020928301929091019060010161173e565b50505092915050565b5f5f60208385031215611777575f5ffd5b823567ffffffffffffffff81111561178d575f5ffd5b61179985828601611656565b90969095509350505050565b5f5f61012083850312156117b7575f5ffd5b60808301848111156117c7575f5ffd5b8392506117d48582611611565b9150509250929050565b602081525f82518060208401525f5b8181101561180a57602081860181015160408684010152016117ed565b505f604082850101526040601f19601f83011684010191505092915050565b5f5f85851115611837575f5ffd5b83861115611843575f5ffd5b5050820193919092039150565b80356001600160e01b03198116906004841015610d76576001600160e01b031960049490940360031b84901b1690921692915050565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f5f61016085870312156118ae575f5ffd5b843593506020850135925060408501359150607f850186136118ce575f5ffd5b604051610100810181811067ffffffffffffffff821117156118f2576118f2611886565b60405280610160870188811115611907575f5ffd5b606088015b8181101561192457803583526020928301920161190c565b50959894975092955093505050565b6101a0810181845f5b600881101561195b57815183526020928301929091019060010161193c565b5050506101008201835f5b6005811015611985578151835260209283019290910190600101611966565b5050509392505050565b818382375f9101908152919050565b5f602082840312156119ae575f5ffd5b5051919050565b634e487b7160e01b5f52601260045260245ffd5b8181038181111561065057634e487b7160e01b5f52601160045260245ffdfe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4730644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001