From 158d563c6eaed29ac8a7876ff133e4a0f2f0e423 Mon Sep 17 00:00:00 2001 From: Oleh Misarosh Date: Mon, 9 Dec 2024 00:05:05 +0700 Subject: [PATCH 1/2] tried migrating to ultrahonk --- packages/contracts/contracts/ZkLogin.sol | 4 ++-- packages/contracts/deploy/00_deploy.ts | 6 ++++++ packages/contracts/noir/target/jwt_account_honk.sol | 3 +++ packages/sdk/src/ZkLoginSdk.ts | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 packages/contracts/noir/target/jwt_account_honk.sol diff --git a/packages/contracts/contracts/ZkLogin.sol b/packages/contracts/contracts/ZkLogin.sol index 5b766d9..add38a8 100644 --- a/packages/contracts/contracts/ZkLogin.sol +++ b/packages/contracts/contracts/ZkLogin.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity ^0.8.27; -import {UltraVerifier} from "../noir/target/jwt_account.sol"; +import {HonkVerifier} from "../noir/target/jwt_account_honk.sol"; import {Strings} from "./Strings.sol"; import {PublicKeyRegistry} from "./PublicKeyRegistry.sol"; @@ -10,7 +10,7 @@ library ZkLogin { bytes32 accountId; bytes32 authProviderId; PublicKeyRegistry publicKeyRegistry; - UltraVerifier proofVerifier; + HonkVerifier proofVerifier; } struct VerificationData { diff --git a/packages/contracts/deploy/00_deploy.ts b/packages/contracts/deploy/00_deploy.ts index 94fa19e..9393f1d 100644 --- a/packages/contracts/deploy/00_deploy.ts +++ b/packages/contracts/deploy/00_deploy.ts @@ -5,6 +5,7 @@ declare module "hardhat/types/runtime" { PublicKeyRegistry: "PublicKeyRegistry"; SimpleAccountFactory: "SimpleAccountFactory"; UltraVerifier: "UltraVerifier"; + HonkVerifier: "HonkVerifier"; } } @@ -24,6 +25,11 @@ const deploy: DeployFunction = async ({ log: true, }); + await typedDeployments.deploy("HonkVerifier", { + from: deployer, + log: true, + }); + const entryPoint = "0x0000000071727De22E5E9d8BAf0edAc6f37da032"; // 0.7.0 await typedDeployments.deploy("SimpleAccountFactory", { from: deployer, diff --git a/packages/contracts/noir/target/jwt_account_honk.sol b/packages/contracts/noir/target/jwt_account_honk.sol new file mode 100644 index 0000000..af9f27b --- /dev/null +++ b/packages/contracts/noir/target/jwt_account_honk.sol @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:005a849c9bc064e10c8249ddaed1dc2a596505f61c7b0b9223fd1aff8c8674f1 +size 83036 diff --git a/packages/sdk/src/ZkLoginSdk.ts b/packages/sdk/src/ZkLoginSdk.ts index 7b02fd5..0fae529 100644 --- a/packages/sdk/src/ZkLoginSdk.ts +++ b/packages/sdk/src/ZkLoginSdk.ts @@ -58,7 +58,7 @@ export class ZkLogin { const publicKeyRegistry = deployments[checkedChainId].contracts .PublicKeyRegistry as Hex.Hex; const proofVerifier = deployments[checkedChainId].contracts - .UltraVerifier as Hex.Hex; + .HonkVerifier as Hex.Hex; const publicKey = await this.publicKeyRegistry.getPublicKeyByKid( decoded.header.kid, @@ -145,12 +145,12 @@ export class ZkLogin { const getNoir = utils.lazyValue(async () => { const { Noir } = await import("@noir-lang/noir_js"); - const { UltraPlonkBackend } = await import("@aztec/bb.js"); + const { UltraHonkBackend } = await import("@aztec/bb.js"); const noir = new Noir(circuit as any); const threads = typeof navigator !== "undefined" ? navigator.hardwareConcurrency : 1; console.log(`Using ${threads} threads`); - const backend = new UltraPlonkBackend(circuit.bytecode, { threads }); + const backend = new UltraHonkBackend(circuit.bytecode, { threads }); return { noir, backend }; }); From af2ca9a467f687b6e8f4ca156e2789cedda6a6cf Mon Sep 17 00:00:00 2001 From: Oleh Misarosh Date: Mon, 9 Dec 2024 11:53:32 +0700 Subject: [PATCH 2/2] verifier based on correct vk --- packages/contracts/deployments.json | 3 +- .../deployments/baseSepolia/HonkVerifier.json | 80 +++++++++ .../baseSepolia/SimpleAccountFactory.json | 46 +++--- .../8d3d7e5538e592539a63aff937e00165.json | 156 ++++++++++++++++++ .../noir/target/jwt_account_honk.sol | 4 +- .../SimpleAccountFactory__factory.ts | 6 +- .../contracts/SimpleAccount__factory.ts | 6 +- .../contracts/TestJwtAccount__factory.ts | 6 +- .../factories/noir/target/index.ts | 4 +- .../HonkVerifier__factory.ts | 3 + .../IVerifier__factory.ts | 3 + .../noir/target/jwt_account_honk.sol/index.ts | 3 + .../contracts/typechain-types/hardhat.d.ts | 36 ++++ packages/contracts/typechain-types/index.ts | 4 + .../typechain-types/noir/target/index.ts | 4 +- .../jwt_account_honk.sol/HonkVerifier.ts | 3 + .../target/jwt_account_honk.sol/IVerifier.ts | 3 + .../noir/target/jwt_account_honk.sol/index.ts | 3 + 18 files changed, 334 insertions(+), 39 deletions(-) create mode 100644 packages/contracts/deployments/baseSepolia/HonkVerifier.json create mode 100644 packages/contracts/deployments/baseSepolia/solcInputs/8d3d7e5538e592539a63aff937e00165.json create mode 100644 packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/HonkVerifier__factory.ts create mode 100644 packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/IVerifier__factory.ts create mode 100644 packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/index.ts create mode 100644 packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/HonkVerifier.ts create mode 100644 packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/IVerifier.ts create mode 100644 packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/index.ts diff --git a/packages/contracts/deployments.json b/packages/contracts/deployments.json index a7a24cb..4fe3f53 100644 --- a/packages/contracts/deployments.json +++ b/packages/contracts/deployments.json @@ -2,8 +2,9 @@ "84532": { "chainId": "84532", "contracts": { + "HonkVerifier": "0x99E1E8F8122eAdc0a2fC1B9dFa147237Bd543cD3", "PublicKeyRegistry": "0xd279B6E1a3322Bc43Ca23C464b2450E5672882d4", - "SimpleAccountFactory": "0x993559431A2d6d3526a11604b5b7B5DE75fEc267", + "SimpleAccountFactory": "0xa712976C582ACa81e2800eF27afcdf157252aAdf", "UltraVerifier": "0xD37D6e4e41Be1F05AfDF653777848Ee4Fff8FBc9" }, "name": "baseSepolia" diff --git a/packages/contracts/deployments/baseSepolia/HonkVerifier.json b/packages/contracts/deployments/baseSepolia/HonkVerifier.json new file mode 100644 index 0000000..b456fdc --- /dev/null +++ b/packages/contracts/deployments/baseSepolia/HonkVerifier.json @@ -0,0 +1,80 @@ +{ + "address": "0x99E1E8F8122eAdc0a2fC1B9dFa147237Bd543cD3", + "abi": [ + { + "inputs": [], + "name": "PublicInputsLengthWrong", + "type": "error" + }, + { + "inputs": [], + "name": "ShpleminiFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SumcheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + }, + { + "internalType": "bytes32[]", + "name": "publicInputs", + "type": "bytes32[]" + } + ], + "name": "verify", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xaf80294fb4216d9f9ec818fb05dc51f048bb9c743351b41318f04be4e5e943c9", + "receipt": { + "to": null, + "from": "0xEE0A4782efd390120A29F050A76B297D078e1df9", + "contractAddress": "0x99E1E8F8122eAdc0a2fC1B9dFa147237Bd543cD3", + "transactionIndex": 3, + "gasUsed": "5348766", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x037a64af2cb2ad789c0c429c8157cba008c6d2e6c7a2ddb581c49192d30b744f", + "transactionHash": "0xaf80294fb4216d9f9ec818fb05dc51f048bb9c743351b41318f04be4e5e943c9", + "logs": [], + "blockNumber": 18975454, + "cumulativeGasUsed": "5444185", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "8d3d7e5538e592539a63aff937e00165", + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"PublicInputsLengthWrong\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ShpleminiFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SumcheckFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"},{\"internalType\":\"bytes32[]\",\"name\":\"publicInputs\",\"type\":\"bytes32[]\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"noir/target/jwt_account_honk.sol\":\"HonkVerifier\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100000000},\"remappings\":[]},\"sources\":{\"noir/target/jwt_account_honk.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Copyright 2022 Aztec\\npragma solidity >=0.8.21;\\n\\nuint256 constant N = 262144;\\nuint256 constant LOG_N = 18;\\nuint256 constant NUMBER_OF_PUBLIC_INPUTS = 67;\\nlibrary HonkVerificationKey {\\n function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) {\\n Honk.VerificationKey memory vk = Honk.VerificationKey({\\n circuitSize: uint256(262144),\\n logCircuitSize: uint256(18),\\n publicInputsSize: uint256(67),\\n ql: Honk.G1Point({ \\n x: uint256(0x128f4689193e8d7e352ac5f0afe29ff277d1b8b08807981784a590b82a9b5e2e),\\n y: uint256(0x1aa8be7d44f5bf4c12440bd390aeb102e211af54f0c176e5a7aaecdf49543574)\\n }),\\n qr: Honk.G1Point({ \\n x: uint256(0x2b0a33558c2603b6bc43635665be9da0f5e2f623bea9e22dd055c74324d7f122),\\n y: uint256(0x162d39578897a70f2dc851710de29d3dd6fae4e768f2c841aa7b95834ceae5cb)\\n }),\\n qo: Honk.G1Point({ \\n x: uint256(0x262d979b29df1669541daa3f02157701ff7ab07a6f5317d2e4d1c4c2106e17e3),\\n y: uint256(0x06af46ef2dc4282de259c7e02867c3c77a799af864e2370f61a8f1aec7a7f409)\\n }),\\n q4: Honk.G1Point({ \\n x: uint256(0x0e45f7edf0975574a0234a5c0510af9251c52534b527f8af7bd17a4c60959096),\\n y: uint256(0x2053c39f8961e378924eb488270ae9caab9db0bbf2d2937c0fef89a40000d214)\\n }),\\n qm: Honk.G1Point({ \\n x: uint256(0x0000000000000000000000000000000000000000000000000000000000000000),\\n y: uint256(0x0000000000000000000000000000000000000000000000000000000000000000)\\n }),\\n qc: Honk.G1Point({ \\n x: uint256(0x0023296072ba882e23ed90ee1dac8eedbb30e5b4fbbf6a8be14cc97eaa446693),\\n y: uint256(0x1540513d0b8971ae7c56b28838a830801b04cc4f3a3dde06c3eac3410a2ee9c4)\\n }),\\n qArith: Honk.G1Point({ \\n x: uint256(0x24792fa51f5beafb9c4eff1a8bf1a9a6ccd9a02877d64ec78becc03bc9f7d1ff),\\n y: uint256(0x2b3a9b5ddd9cf49b41974c5cb73e39997fd915a8df5b8458fa08d02a55a96443)\\n }),\\n qDeltaRange: Honk.G1Point({ \\n x: uint256(0x1df1862c3cd967cf4e80a289e6fec969049ae11aac5a796ac650315d22e580fb),\\n y: uint256(0x2afb83456939046324306525332ef3307638d6766ff90e40559aa45e471b871b)\\n }),\\n qElliptic: Honk.G1Point({ \\n x: uint256(0x286ee766413caa93518a7570875801a9159d2e1315c1ab5bc9e52595a830c495),\\n y: uint256(0x045175bd839a41eda5e9b6a40f76bbbf2723a68e1e7ecd739bd97ae093cd6528)\\n }),\\n qAux: Honk.G1Point({ \\n x: uint256(0x1c2f84adf95896cf0018ae79ebbdeb2468b1404953a855ec2facc4b494495433),\\n y: uint256(0x0a175b5ba1452877e6cb7ac6ca850788f7e17a56f310cb5f18d9642b7bdcbcf2)\\n }),\\n qLookup: Honk.G1Point({ \\n x: uint256(0x22ffd03e53836f0a9271398e34a792953979926b49a76c967c71cc8af35e04bb),\\n y: uint256(0x02e2ae071779429f971820e5d680764ae55b0a0db4bc14709d47abc261cfe64c)\\n }),\\n qPoseidon2External: Honk.G1Point({ \\n x: uint256(0x034ab86a5bccfa4f69637da232ba777f403c1aeb69ad6040d432a795e1b382c2),\\n y: uint256(0x09a353e2a34ad0af28688dbf4c01cc7de2c9878d6a1b80ce58e567d6c48b5bec)\\n }),\\n qPoseidon2Internal: Honk.G1Point({ \\n x: uint256(0x1a65519a1ab82173d9cb9dc061f62c9d53ef95915b0cc76feb9feb90351e810d),\\n y: uint256(0x29c0afd9c7eeae8e1635b3835090d59d5344bd56cf3c71487adcf6d8c5844348)\\n }),\\n s1: Honk.G1Point({ \\n x: uint256(0x139c2f5bba86aea351df6608e3f1cd26b3c0b4371dca357e701a6025f94be1e7),\\n y: uint256(0x22399eb57ad19a4409a194335726da4d76a0cf2d0d89a50dbc7f687de1aad8c3)\\n }),\\n s2: Honk.G1Point({ \\n x: uint256(0x0ff16a5ae01ecffc7815eb75c174ad14281aa49059929907518634d841c628f5),\\n y: uint256(0x2d867f1d311969273bc82b184e63d9269b182a881d3b302b242a4dc93462f7b7)\\n }),\\n s3: Honk.G1Point({ \\n x: uint256(0x0821760c77fc15784afcaff815f73f8f90aa38ebe34d3b48695e3a6ad08ed8b0),\\n y: uint256(0x2f51bc8941e5c577f7ec1d5bb038bd902c7a5c7dd1389bab38b9c89ec4ab7d29)\\n }),\\n s4: Honk.G1Point({ \\n x: uint256(0x0ffd51787978d66be3b7e70e810c4575178c9f45674db1b870595ce7e2fb5f6f),\\n y: uint256(0x17a63d56e53061da2fe13b311859cb536d18d6060100c393c5bb9251dfbad74a)\\n }),\\n t1: Honk.G1Point({ \\n x: uint256(0x234c57b9aab8dfb66855cbb2ed5c7dcaa724527a8b5abae05dbfc771da6679cc),\\n y: uint256(0x22060d556338e2843aed696c8fc98bf0c6d133543b5c8774daf51221e0eafb44)\\n }),\\n t2: Honk.G1Point({ \\n x: uint256(0x2c931d2ddd0a37bf249ba13d4c0005dcf10f905b44f587692f7e19c4325beece),\\n y: uint256(0x02d3dc1f3ed31519bae6c333e090615800a04cfdc9d6233f823114a44746d501)\\n }),\\n t3: Honk.G1Point({ \\n x: uint256(0x06246fd4811f690574ddc55745590439a8f73455e78fdd3521d65c7e007e6b45),\\n y: uint256(0x1e132a30f5aa1d892595234280dd91b7728b3dadc7b72e58f2a95148f38ba210)\\n }),\\n t4: Honk.G1Point({ \\n x: uint256(0x1e0181f12b41a00b4ee891ed5a942bfdbae834b4faf95ce9e9aaa9bd2500ce63),\\n y: uint256(0x1b6f032aa6b07625de54649d25628c9a5c45ab7c6c13a88fdd31ca7ecce024af)\\n }),\\n id1: Honk.G1Point({ \\n x: uint256(0x024dcf715a66fd964f629553ae2bcb51c127b813ed7f9a4b28b481fb9e2c3772),\\n y: uint256(0x20244a5d7222400941070d0355a58d34ab8ff9b0d8935fd8c9225059f13fcaac)\\n }),\\n id2: Honk.G1Point({ \\n x: uint256(0x02987fe7cdb3cab8ebf18ecc8711b792828a0670bd9bcd17442c4a157325c8ef),\\n y: uint256(0x1c9fa626c623b3102d77b2878a9de76dd9a1837521baa49c6874797a8e5a9626)\\n }),\\n id3: Honk.G1Point({ \\n x: uint256(0x130b070560870337eb165683645e3c8522d6449e1367a35c5cf00dd4462fd967),\\n y: uint256(0x01fe23c3926178b337c362c53b74d2233d08cf587bb0f114ebfe21542c9645e5)\\n }),\\n id4: Honk.G1Point({ \\n x: uint256(0x153a7f8639e06461474e00018cde1ac1acf38089893c5515de20804922c03219),\\n y: uint256(0x0939c3d22ab03cefb504fe214af93d65912ae3750ce6b756b0e02c9ce7a16e68)\\n }),\\n lagrangeFirst: Honk.G1Point({ \\n x: uint256(0x19b09aa2fcb34ae480845aa4ad56e01616ae845300e6f676fdb84f4bd396851b),\\n y: uint256(0x295d8a6bfcce573b23d5eefd0aab6d32479423acd4956ce6deb5a67073f032d5)\\n }),\\n lagrangeLast: Honk.G1Point({ \\n x: uint256(0x08d314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b),\\n y: uint256(0x0100000000000000000000000000000000000000000000000000000000000000)\\n })\\n });\\n return vk;\\n }\\n}\\n\\npragma solidity ^0.8.27;\\n\\ntype Fr is uint256;\\n\\nusing { add as + } for Fr global;\\nusing { sub as - } for Fr global;\\nusing { mul as * } for Fr global;\\nusing { exp as ^ } for Fr global;\\nusing { notEqual as != } for Fr global;\\nusing { equal as == } for Fr global;\\n\\nuint256 constant MODULUS =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617; // Prime field order\\n\\nFr constant MINUS_ONE = Fr.wrap(MODULUS - 1);\\n\\n// Instantiation\\nlibrary FrLib\\n{\\n function from(uint256 value) internal pure returns(Fr)\\n {\\n return Fr.wrap(value % MODULUS);\\n }\\n\\n function fromBytes32(bytes32 value) internal pure returns(Fr)\\n {\\n return Fr.wrap(uint256(value) % MODULUS);\\n }\\n\\n function toBytes32(Fr value) internal pure returns(bytes32)\\n {\\n return bytes32(Fr.unwrap(value));\\n }\\n\\n function invert(Fr value) internal view returns(Fr)\\n {\\n uint256 v = Fr.unwrap(value);\\n uint256 result;\\n\\n // Call the modexp precompile to invert in the field\\n assembly\\n {\\n let free := mload(0x40)\\n mstore(free, 0x20)\\n mstore(add(free, 0x20), 0x20)\\n mstore(add(free, 0x40), 0x20)\\n mstore(add(free, 0x60), v)\\n mstore(add(free, 0x80), sub(MODULUS, 2))\\n mstore(add(free, 0xa0), MODULUS)\\n let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)\\n if iszero(success) {\\n revert(0, 0)\\n }\\n result := mload(0x00)\\n }\\n\\n return Fr.wrap(result);\\n }\\n\\n function pow(Fr base, uint256 v) internal view returns(Fr)\\n {\\n uint256 b = Fr.unwrap(base);\\n uint256 result;\\n\\n // Call the modexp precompile to invert in the field\\n assembly\\n {\\n let free := mload(0x40)\\n mstore(free, 0x20)\\n mstore(add(free, 0x20), 0x20)\\n mstore(add(free, 0x40), 0x20)\\n mstore(add(free, 0x60), b)\\n mstore(add(free, 0x80), v)\\n mstore(add(free, 0xa0), MODULUS)\\n let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)\\n if iszero(success) {\\n revert(0, 0)\\n }\\n result := mload(0x00)\\n }\\n\\n return Fr.wrap(result);\\n }\\n\\n function div(Fr numerator, Fr denominator) internal view returns(Fr)\\n {\\n return numerator * invert(denominator);\\n }\\n\\n function sqr(Fr value) internal pure returns (Fr) {\\n return value * value;\\n }\\n\\n function unwrap(Fr value) internal pure returns (uint256) {\\n return Fr.unwrap(value);\\n }\\n\\n function neg(Fr value) internal pure returns (Fr) {\\n return Fr.wrap(MODULUS - Fr.unwrap(value));\\n }\\n}\\n\\n// Free functions\\nfunction add(Fr a, Fr b) pure returns(Fr)\\n{\\n return Fr.wrap(addmod(Fr.unwrap(a), Fr.unwrap(b), MODULUS));\\n}\\n\\nfunction mul(Fr a, Fr b) pure returns(Fr)\\n{\\n return Fr.wrap(mulmod(Fr.unwrap(a), Fr.unwrap(b), MODULUS));\\n}\\n\\nfunction sub(Fr a, Fr b) pure returns(Fr)\\n{\\n return Fr.wrap(addmod(Fr.unwrap(a), MODULUS - Fr.unwrap(b), MODULUS));\\n}\\n\\nfunction exp(Fr base, Fr exponent) pure returns(Fr)\\n{\\n if (Fr.unwrap(exponent) == 0) return Fr.wrap(1);\\n\\n for (uint256 i = 1; i < Fr.unwrap(exponent); i += i) {\\n base = base * base;\\n }\\n return base;\\n}\\n\\nfunction notEqual(Fr a, Fr b) pure returns(bool)\\n{\\n return Fr.unwrap(a) != Fr.unwrap(b);\\n}\\n\\nfunction equal(Fr a, Fr b) pure returns(bool)\\n{\\n return Fr.unwrap(a) == Fr.unwrap(b);\\n}\\n\\nuint256 constant CONST_PROOF_SIZE_LOG_N = 28;\\n\\nuint256 constant NUMBER_OF_SUBRELATIONS = 26;\\nuint256 constant BATCHED_RELATION_PARTIAL_LENGTH = 8;\\nuint256 constant NUMBER_OF_ENTITIES = 44;\\nuint256 constant NUMBER_UNSHIFTED = 35;\\nuint256 constant NUMBER_TO_BE_SHIFTED = 9;\\n\\n// Alphas are used as relation separators so there should be NUMBER_OF_SUBRELATIONS - 1\\nuint256 constant NUMBER_OF_ALPHAS = 25;\\n\\n// Prime field order\\nuint256 constant Q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; // EC group order. F_q\\nuint256 constant P = 21888242871839275222246405745257275088548364400416034343698204186575808495617; // Prime field order, F_r\\n\\n// ENUM FOR WIRES\\nenum WIRE {\\n Q_M,\\n Q_C,\\n Q_L,\\n Q_R,\\n Q_O,\\n Q_4,\\n Q_ARITH,\\n Q_RANGE,\\n Q_ELLIPTIC,\\n Q_AUX,\\n Q_LOOKUP,\\n Q_POSEIDON2_EXTERNAL,\\n Q_POSEIDON2_INTERNAL,\\n SIGMA_1,\\n SIGMA_2,\\n SIGMA_3,\\n SIGMA_4,\\n ID_1,\\n ID_2,\\n ID_3,\\n ID_4,\\n TABLE_1,\\n TABLE_2,\\n TABLE_3,\\n TABLE_4,\\n LAGRANGE_FIRST,\\n LAGRANGE_LAST,\\n W_L,\\n W_R,\\n W_O,\\n W_4,\\n Z_PERM,\\n LOOKUP_INVERSES,\\n LOOKUP_READ_COUNTS,\\n LOOKUP_READ_TAGS,\\n TABLE_1_SHIFT,\\n TABLE_2_SHIFT,\\n TABLE_3_SHIFT,\\n TABLE_4_SHIFT,\\n W_L_SHIFT,\\n W_R_SHIFT,\\n W_O_SHIFT,\\n W_4_SHIFT,\\n Z_PERM_SHIFT\\n}\\n\\nlibrary Honk {\\n struct G1Point {\\n uint256 x;\\n uint256 y;\\n }\\n\\n struct G1ProofPoint {\\n uint256 x_0;\\n uint256 x_1;\\n uint256 y_0;\\n uint256 y_1;\\n }\\n\\n struct VerificationKey {\\n // Misc Params\\n uint256 circuitSize;\\n uint256 logCircuitSize;\\n uint256 publicInputsSize;\\n // Selectors\\n G1Point qm;\\n G1Point qc;\\n G1Point ql;\\n G1Point qr;\\n G1Point qo;\\n G1Point q4;\\n G1Point qArith; // Arithmetic widget\\n G1Point qDeltaRange; // Delta Range sort\\n G1Point qAux; // Auxillary\\n G1Point qElliptic; // Auxillary\\n G1Point qLookup; // Lookup\\n G1Point qPoseidon2External;\\n G1Point qPoseidon2Internal;\\n // Copy cnstraints\\n G1Point s1;\\n G1Point s2;\\n G1Point s3;\\n G1Point s4;\\n // Copy identity\\n G1Point id1;\\n G1Point id2;\\n G1Point id3;\\n G1Point id4;\\n // Precomputed lookup table\\n G1Point t1;\\n G1Point t2;\\n G1Point t3;\\n G1Point t4;\\n // Fixed first and last\\n G1Point lagrangeFirst;\\n G1Point lagrangeLast;\\n }\\n\\n struct Proof {\\n uint256 circuitSize;\\n uint256 publicInputsSize;\\n uint256 publicInputsOffset;\\n // Free wires\\n Honk.G1ProofPoint w1;\\n Honk.G1ProofPoint w2;\\n Honk.G1ProofPoint w3;\\n Honk.G1ProofPoint w4;\\n // Lookup helpers - Permutations\\n Honk.G1ProofPoint zPerm;\\n // Lookup helpers - logup\\n Honk.G1ProofPoint lookupReadCounts;\\n Honk.G1ProofPoint lookupReadTags;\\n Honk.G1ProofPoint lookupInverses;\\n // Sumcheck\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH][CONST_PROOF_SIZE_LOG_N] sumcheckUnivariates;\\n Fr[NUMBER_OF_ENTITIES] sumcheckEvaluations;\\n // Shplemini\\n Honk.G1ProofPoint[CONST_PROOF_SIZE_LOG_N - 1] geminiFoldComms;\\n Fr[CONST_PROOF_SIZE_LOG_N] geminiAEvaluations;\\n Honk.G1ProofPoint shplonkQ;\\n Honk.G1ProofPoint kzgQuotient;\\n }\\n}\\n\\n\\n// Transcript library to generate fiat shamir challenges\\nstruct Transcript {\\n Fr eta;\\n Fr etaTwo;\\n Fr etaThree;\\n Fr beta;\\n Fr gamma;\\n Fr[NUMBER_OF_ALPHAS] alphas;\\n Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges;\\n Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges;\\n // Shplemini\\n Fr rho;\\n Fr geminiR;\\n Fr shplonkNu;\\n Fr shplonkZ;\\n // Derived\\n Fr publicInputsDelta;\\n}\\n\\nlibrary TranscriptLib {\\n function generateTranscript(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize)\\n internal\\n pure\\n returns (Transcript memory t)\\n {\\n Fr previousChallenge;\\n (t.eta, t.etaTwo, t.etaThree, previousChallenge) = generateEtaChallenge(proof, publicInputs, publicInputsSize);\\n\\n (t.beta, t.gamma, previousChallenge) = generateBetaAndGammaChallenges(previousChallenge, proof);\\n\\n (t.alphas, previousChallenge) = generateAlphaChallenges(previousChallenge, proof);\\n\\n (t.gateChallenges, previousChallenge) = generateGateChallenges(previousChallenge);\\n\\n (t.sumCheckUChallenges, previousChallenge) = generateSumcheckChallenges(proof, previousChallenge);\\n\\n (t.rho, previousChallenge) = generateRhoChallenge(proof, previousChallenge);\\n\\n (t.geminiR, previousChallenge) = generateGeminiRChallenge(proof, previousChallenge);\\n\\n (t.shplonkNu, previousChallenge) = generateShplonkNuChallenge(proof, previousChallenge);\\n\\n (t.shplonkZ, previousChallenge) = generateShplonkZChallenge(proof, previousChallenge);\\n\\n return t;\\n }\\n\\n function splitChallenge(Fr challenge) internal pure returns (Fr first, Fr second) {\\n uint256 challengeU256 = uint256(Fr.unwrap(challenge));\\n uint256 lo = challengeU256 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;\\n uint256 hi = challengeU256 >> 128;\\n first = FrLib.fromBytes32(bytes32(lo));\\n second = FrLib.fromBytes32(bytes32(hi));\\n }\\n\\n function generateEtaChallenge(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize)\\n internal\\n pure\\n returns (Fr eta, Fr etaTwo, Fr etaThree, Fr previousChallenge)\\n {\\n bytes32[] memory round0 = new bytes32[](3 + publicInputsSize + 12);\\n round0[0] = bytes32(proof.circuitSize);\\n round0[1] = bytes32(proof.publicInputsSize);\\n round0[2] = bytes32(proof.publicInputsOffset);\\n for (uint256 i = 0; i < publicInputsSize; i++) {\\n round0[3 + i] = bytes32(publicInputs[i]);\\n }\\n\\n // Create the first challenge\\n // Note: w4 is added to the challenge later on\\n round0[3 + publicInputsSize] = bytes32(proof.w1.x_0);\\n round0[3 + publicInputsSize + 1] = bytes32(proof.w1.x_1);\\n round0[3 + publicInputsSize + 2] = bytes32(proof.w1.y_0);\\n round0[3 + publicInputsSize + 3] = bytes32(proof.w1.y_1);\\n round0[3 + publicInputsSize + 4] = bytes32(proof.w2.x_0);\\n round0[3 + publicInputsSize + 5] = bytes32(proof.w2.x_1);\\n round0[3 + publicInputsSize + 6] = bytes32(proof.w2.y_0);\\n round0[3 + publicInputsSize + 7] = bytes32(proof.w2.y_1);\\n round0[3 + publicInputsSize + 8] = bytes32(proof.w3.x_0);\\n round0[3 + publicInputsSize + 9] = bytes32(proof.w3.x_1);\\n round0[3 + publicInputsSize + 10] = bytes32(proof.w3.y_0);\\n round0[3 + publicInputsSize + 11] = bytes32(proof.w3.y_1);\\n\\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(round0)));\\n (eta, etaTwo) = splitChallenge(previousChallenge);\\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge))));\\n Fr unused;\\n (etaThree, unused) = splitChallenge(previousChallenge);\\n }\\n\\n function generateBetaAndGammaChallenges(Fr previousChallenge, Honk.Proof memory proof)\\n internal\\n pure\\n returns (Fr beta, Fr gamma, Fr nextPreviousChallenge)\\n {\\n bytes32[13] memory round1;\\n round1[0] = FrLib.toBytes32(previousChallenge);\\n round1[1] = bytes32(proof.lookupReadCounts.x_0);\\n round1[2] = bytes32(proof.lookupReadCounts.x_1);\\n round1[3] = bytes32(proof.lookupReadCounts.y_0);\\n round1[4] = bytes32(proof.lookupReadCounts.y_1);\\n round1[5] = bytes32(proof.lookupReadTags.x_0);\\n round1[6] = bytes32(proof.lookupReadTags.x_1);\\n round1[7] = bytes32(proof.lookupReadTags.y_0);\\n round1[8] = bytes32(proof.lookupReadTags.y_1);\\n round1[9] = bytes32(proof.w4.x_0);\\n round1[10] = bytes32(proof.w4.x_1);\\n round1[11] = bytes32(proof.w4.y_0);\\n round1[12] = bytes32(proof.w4.y_1);\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(round1)));\\n (beta, gamma) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n // Alpha challenges non-linearise the gate contributions\\n function generateAlphaChallenges(Fr previousChallenge, Honk.Proof memory proof)\\n internal\\n pure\\n returns (Fr[NUMBER_OF_ALPHAS] memory alphas, Fr nextPreviousChallenge)\\n {\\n // Generate the original sumcheck alpha 0 by hashing zPerm and zLookup\\n uint256[9] memory alpha0;\\n alpha0[0] = Fr.unwrap(previousChallenge);\\n alpha0[1] = proof.lookupInverses.x_0;\\n alpha0[2] = proof.lookupInverses.x_1;\\n alpha0[3] = proof.lookupInverses.y_0;\\n alpha0[4] = proof.lookupInverses.y_1;\\n alpha0[5] = proof.zPerm.x_0;\\n alpha0[6] = proof.zPerm.x_1;\\n alpha0[7] = proof.zPerm.y_0;\\n alpha0[8] = proof.zPerm.y_1;\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(alpha0)));\\n (alphas[0], alphas[1]) = splitChallenge(nextPreviousChallenge);\\n\\n for (uint256 i = 1; i < NUMBER_OF_ALPHAS / 2; i++) {\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(nextPreviousChallenge))));\\n (alphas[2 * i], alphas[2 * i + 1]) = splitChallenge(nextPreviousChallenge);\\n }\\n if (((NUMBER_OF_ALPHAS & 1) == 1) && (NUMBER_OF_ALPHAS > 2)) {\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(nextPreviousChallenge))));\\n Fr unused;\\n (alphas[NUMBER_OF_ALPHAS - 1], unused) = splitChallenge(nextPreviousChallenge);\\n }\\n }\\n\\n function generateGateChallenges(Fr previousChallenge)\\n internal\\n pure\\n returns (Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges, Fr nextPreviousChallenge)\\n {\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge))));\\n Fr unused;\\n (gateChallenges[i], unused) = splitChallenge(previousChallenge);\\n }\\n nextPreviousChallenge = previousChallenge;\\n }\\n\\n function generateSumcheckChallenges(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr[CONST_PROOF_SIZE_LOG_N] memory sumcheckChallenges, Fr nextPreviousChallenge)\\n {\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH + 1] memory univariateChal;\\n univariateChal[0] = prevChallenge;\\n\\n for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) {\\n univariateChal[j + 1] = proof.sumcheckUnivariates[i][j];\\n }\\n prevChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(univariateChal)));\\n Fr unused;\\n (sumcheckChallenges[i], unused) = splitChallenge(prevChallenge);\\n }\\n nextPreviousChallenge = prevChallenge;\\n }\\n\\n function generateRhoChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr rho, Fr nextPreviousChallenge)\\n {\\n Fr[NUMBER_OF_ENTITIES + 1] memory rhoChallengeElements;\\n rhoChallengeElements[0] = prevChallenge;\\n\\n for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) {\\n rhoChallengeElements[i + 1] = proof.sumcheckEvaluations[i];\\n }\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(rhoChallengeElements)));\\n Fr unused;\\n (rho, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function generateGeminiRChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr geminiR, Fr nextPreviousChallenge)\\n {\\n uint256[(CONST_PROOF_SIZE_LOG_N - 1) * 4 + 1] memory gR;\\n gR[0] = Fr.unwrap(prevChallenge);\\n\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) {\\n gR[1 + i * 4] = proof.geminiFoldComms[i].x_0;\\n gR[2 + i * 4] = proof.geminiFoldComms[i].x_1;\\n gR[3 + i * 4] = proof.geminiFoldComms[i].y_0;\\n gR[4 + i * 4] = proof.geminiFoldComms[i].y_1;\\n }\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(gR)));\\n Fr unused;\\n (geminiR, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function generateShplonkNuChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr shplonkNu, Fr nextPreviousChallenge)\\n {\\n uint256[(CONST_PROOF_SIZE_LOG_N) + 1] memory shplonkNuChallengeElements;\\n shplonkNuChallengeElements[0] = Fr.unwrap(prevChallenge);\\n\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n shplonkNuChallengeElements[i + 1] = Fr.unwrap(proof.geminiAEvaluations[i]);\\n }\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(shplonkNuChallengeElements)));\\n Fr unused;\\n (shplonkNu, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function generateShplonkZChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr shplonkZ, Fr nextPreviousChallenge)\\n {\\n uint256[5] memory shplonkZChallengeElements;\\n shplonkZChallengeElements[0] = Fr.unwrap(prevChallenge);\\n\\n shplonkZChallengeElements[1] = proof.shplonkQ.x_0;\\n shplonkZChallengeElements[2] = proof.shplonkQ.x_1;\\n shplonkZChallengeElements[3] = proof.shplonkQ.y_0;\\n shplonkZChallengeElements[4] = proof.shplonkQ.y_1;\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(shplonkZChallengeElements)));\\n Fr unused;\\n (shplonkZ, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function loadProof(bytes calldata proof) internal pure returns (Honk.Proof memory) {\\n Honk.Proof memory p;\\n\\n // Metadata\\n p.circuitSize = uint256(bytes32(proof[0x00:0x20]));\\n p.publicInputsSize = uint256(bytes32(proof[0x20:0x40]));\\n p.publicInputsOffset = uint256(bytes32(proof[0x40:0x60]));\\n\\n // Commitments\\n p.w1 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x60:0x80])),\\n x_1: uint256(bytes32(proof[0x80:0xa0])),\\n y_0: uint256(bytes32(proof[0xa0:0xc0])),\\n y_1: uint256(bytes32(proof[0xc0:0xe0]))\\n });\\n\\n p.w2 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0xe0:0x100])),\\n x_1: uint256(bytes32(proof[0x100:0x120])),\\n y_0: uint256(bytes32(proof[0x120:0x140])),\\n y_1: uint256(bytes32(proof[0x140:0x160]))\\n });\\n p.w3 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x160:0x180])),\\n x_1: uint256(bytes32(proof[0x180:0x1a0])),\\n y_0: uint256(bytes32(proof[0x1a0:0x1c0])),\\n y_1: uint256(bytes32(proof[0x1c0:0x1e0]))\\n });\\n\\n // Lookup / Permutation Helper Commitments\\n p.lookupReadCounts = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x1e0:0x200])),\\n x_1: uint256(bytes32(proof[0x200:0x220])),\\n y_0: uint256(bytes32(proof[0x220:0x240])),\\n y_1: uint256(bytes32(proof[0x240:0x260]))\\n });\\n p.lookupReadTags = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x260:0x280])),\\n x_1: uint256(bytes32(proof[0x280:0x2a0])),\\n y_0: uint256(bytes32(proof[0x2a0:0x2c0])),\\n y_1: uint256(bytes32(proof[0x2c0:0x2e0]))\\n });\\n p.w4 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x2e0:0x300])),\\n x_1: uint256(bytes32(proof[0x300:0x320])),\\n y_0: uint256(bytes32(proof[0x320:0x340])),\\n y_1: uint256(bytes32(proof[0x340:0x360]))\\n });\\n p.lookupInverses = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x360:0x380])),\\n x_1: uint256(bytes32(proof[0x380:0x3a0])),\\n y_0: uint256(bytes32(proof[0x3a0:0x3c0])),\\n y_1: uint256(bytes32(proof[0x3c0:0x3e0]))\\n });\\n p.zPerm = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x3e0:0x400])),\\n x_1: uint256(bytes32(proof[0x400:0x420])),\\n y_0: uint256(bytes32(proof[0x420:0x440])),\\n y_1: uint256(bytes32(proof[0x440:0x460]))\\n });\\n\\n // Boundary represents a pointer to the head of the unread part of the proof\\n uint256 boundary = 0x460;\\n\\n // Sumcheck univariates\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n // The loop boundary of i, this will shift forward on each evaluation\\n uint256 loop_boundary = boundary + (i * 0x20 * BATCHED_RELATION_PARTIAL_LENGTH);\\n\\n for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) {\\n uint256 start = loop_boundary + (j * 0x20);\\n uint256 end = start + 0x20;\\n p.sumcheckUnivariates[i][j] = FrLib.fromBytes32(bytes32(proof[start:end]));\\n }\\n }\\n\\n boundary = boundary + (CONST_PROOF_SIZE_LOG_N * BATCHED_RELATION_PARTIAL_LENGTH * 0x20);\\n // Sumcheck evaluations\\n for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) {\\n uint256 start = boundary + (i * 0x20);\\n uint256 end = start + 0x20;\\n p.sumcheckEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end]));\\n }\\n\\n boundary = boundary + (NUMBER_OF_ENTITIES * 0x20);\\n\\n // Gemini\\n // Read gemini fold univariates\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) {\\n uint256 xStart = boundary + (i * 0x80);\\n uint256 xEnd = xStart + 0x20;\\n\\n uint256 x1Start = xEnd;\\n uint256 x1End = x1Start + 0x20;\\n\\n uint256 yStart = x1End;\\n uint256 yEnd = yStart + 0x20;\\n\\n uint256 y1Start = yEnd;\\n uint256 y1End = y1Start + 0x20;\\n p.geminiFoldComms[i] = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[xStart:xEnd])),\\n x_1: uint256(bytes32(proof[x1Start:x1End])),\\n y_0: uint256(bytes32(proof[yStart:yEnd])),\\n y_1: uint256(bytes32(proof[y1Start:y1End]))\\n });\\n }\\n\\n boundary = boundary + ((CONST_PROOF_SIZE_LOG_N - 1) * 0x80);\\n\\n // Read gemini a evaluations\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n uint256 start = boundary + (i * 0x20);\\n uint256 end = start + 0x20;\\n p.geminiAEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end]));\\n }\\n\\n boundary = boundary + (CONST_PROOF_SIZE_LOG_N * 0x20);\\n\\n // Shplonk\\n p.shplonkQ = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[boundary:boundary + 0x20])),\\n x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])),\\n y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])),\\n y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80]))\\n });\\n\\n boundary = boundary + 0x80;\\n\\n // KZG\\n p.kzgQuotient = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[boundary:boundary + 0x20])),\\n x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])),\\n y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])),\\n y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80]))\\n });\\n\\n return p;\\n }\\n}\\n\\n// EC Point utilities\\nfunction convertProofPoint(Honk.G1ProofPoint memory input) pure returns (Honk.G1Point memory) {\\n return Honk.G1Point({x: input.x_0 | (input.x_1 << 136), y: input.y_0 | (input.y_1 << 136)});\\n}\\n\\nfunction ecMul(Honk.G1Point memory point, Fr scalar) view returns (Honk.G1Point memory) {\\n bytes memory input = abi.encodePacked(point.x, point.y, Fr.unwrap(scalar));\\n (bool success, bytes memory result) = address(0x07).staticcall(input);\\n require(success, \\\"ecMul failed\\\");\\n\\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\\n return Honk.G1Point({x: x, y: y});\\n}\\n\\nfunction ecAdd(Honk.G1Point memory point0, Honk.G1Point memory point1) view returns (Honk.G1Point memory) {\\n bytes memory input = abi.encodePacked(point0.x, point0.y, point1.x, point1.y);\\n (bool success, bytes memory result) = address(0x06).staticcall(input);\\n require(success, \\\"ecAdd failed\\\");\\n\\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\\n return Honk.G1Point({x: x, y: y});\\n}\\n\\nfunction ecSub(Honk.G1Point memory point0, Honk.G1Point memory point1) view returns (Honk.G1Point memory) {\\n // We negate the second point\\n uint256 negativePoint1Y = (Q - point1.y) % Q;\\n bytes memory input = abi.encodePacked(point0.x, point0.y, point1.x, negativePoint1Y);\\n (bool success, bytes memory result) = address(0x06).staticcall(input);\\n require(success, \\\"ecAdd failed\\\");\\n\\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\\n return Honk.G1Point({x: x, y: y});\\n}\\n\\nfunction negateInplace(Honk.G1Point memory point) pure returns (Honk.G1Point memory) {\\n point.y = (Q - point.y) % Q;\\n return point;\\n}\\n\\n\\nlibrary RelationsLib {\\n Fr internal constant GRUMPKIN_CURVE_B_PARAMETER_NEGATED = Fr.wrap(17); // -(-17)\\n\\n function accumulateRelationEvaluations(Honk.Proof memory proof, Transcript memory tp, Fr powPartialEval)\\n internal\\n pure\\n returns (Fr accumulator)\\n {\\n Fr[NUMBER_OF_ENTITIES] memory purportedEvaluations = proof.sumcheckEvaluations;\\n Fr[NUMBER_OF_SUBRELATIONS] memory evaluations;\\n\\n // Accumulate all relations in Ultra Honk - each with varying number of subrelations\\n accumulateArithmeticRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulatePermutationRelation(purportedEvaluations, tp, evaluations, powPartialEval);\\n accumulateLogDerivativeLookupRelation(purportedEvaluations, tp, evaluations, powPartialEval);\\n accumulateDeltaRangeRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulateEllipticRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulateAuxillaryRelation(purportedEvaluations, tp, evaluations, powPartialEval);\\n accumulatePoseidonExternalRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulatePoseidonInternalRelation(purportedEvaluations, evaluations, powPartialEval);\\n // batch the subrelations with the alpha challenges to obtain the full honk relation\\n accumulator = scaleAndBatchSubrelations(evaluations, tp.alphas);\\n }\\n\\n /**\\n * Aesthetic helper function that is used to index by enum into proof.sumcheckEvaluations, it avoids\\n * the relation checking code being cluttered with uint256 type casting, which is often a different colour in code\\n * editors, and thus is noisy.\\n */\\n function wire(Fr[NUMBER_OF_ENTITIES] memory p, WIRE _wire) internal pure returns (Fr) {\\n return p[uint256(_wire)];\\n }\\n\\n uint256 internal constant NEG_HALF_MODULO_P = 0x183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f8000000;\\n /**\\n * Ultra Arithmetic Relation\\n *\\n */\\n function accumulateArithmeticRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n // Relation 0\\n Fr q_arith = wire(p, WIRE.Q_ARITH);\\n {\\n Fr neg_half = Fr.wrap(NEG_HALF_MODULO_P);\\n\\n Fr accum = (q_arith - Fr.wrap(3)) * (wire(p, WIRE.Q_M) * wire(p, WIRE.W_R) * wire(p, WIRE.W_L)) * neg_half;\\n accum = accum + (wire(p, WIRE.Q_L) * wire(p, WIRE.W_L)) + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_R))\\n + (wire(p, WIRE.Q_O) * wire(p, WIRE.W_O)) + (wire(p, WIRE.Q_4) * wire(p, WIRE.W_4)) + wire(p, WIRE.Q_C);\\n accum = accum + (q_arith - Fr.wrap(1)) * wire(p, WIRE.W_4_SHIFT);\\n accum = accum * q_arith;\\n accum = accum * domainSep;\\n evals[0] = accum;\\n }\\n\\n // Relation 1\\n {\\n Fr accum = wire(p, WIRE.W_L) + wire(p, WIRE.W_4) - wire(p, WIRE.W_L_SHIFT) + wire(p, WIRE.Q_M);\\n accum = accum * (q_arith - Fr.wrap(2));\\n accum = accum * (q_arith - Fr.wrap(1));\\n accum = accum * q_arith;\\n accum = accum * domainSep;\\n evals[1] = accum;\\n }\\n }\\n\\n function accumulatePermutationRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Transcript memory tp,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n Fr grand_product_numerator;\\n Fr grand_product_denominator;\\n\\n {\\n Fr num = wire(p, WIRE.W_L) + wire(p, WIRE.ID_1) * tp.beta + tp.gamma;\\n num = num * (wire(p, WIRE.W_R) + wire(p, WIRE.ID_2) * tp.beta + tp.gamma);\\n num = num * (wire(p, WIRE.W_O) + wire(p, WIRE.ID_3) * tp.beta + tp.gamma);\\n num = num * (wire(p, WIRE.W_4) + wire(p, WIRE.ID_4) * tp.beta + tp.gamma);\\n\\n grand_product_numerator = num;\\n }\\n {\\n Fr den = wire(p, WIRE.W_L) + wire(p, WIRE.SIGMA_1) * tp.beta + tp.gamma;\\n den = den * (wire(p, WIRE.W_R) + wire(p, WIRE.SIGMA_2) * tp.beta + tp.gamma);\\n den = den * (wire(p, WIRE.W_O) + wire(p, WIRE.SIGMA_3) * tp.beta + tp.gamma);\\n den = den * (wire(p, WIRE.W_4) + wire(p, WIRE.SIGMA_4) * tp.beta + tp.gamma);\\n\\n grand_product_denominator = den;\\n }\\n\\n // Contribution 2\\n {\\n Fr acc = (wire(p, WIRE.Z_PERM) + wire(p, WIRE.LAGRANGE_FIRST)) * grand_product_numerator;\\n\\n acc = acc\\n - (\\n (wire(p, WIRE.Z_PERM_SHIFT) + (wire(p, WIRE.LAGRANGE_LAST) * tp.publicInputsDelta))\\n * grand_product_denominator\\n );\\n acc = acc * domainSep;\\n evals[2] = acc;\\n }\\n\\n // Contribution 3\\n {\\n Fr acc = (wire(p, WIRE.LAGRANGE_LAST) * wire(p, WIRE.Z_PERM_SHIFT)) * domainSep;\\n evals[3] = acc;\\n }\\n }\\n\\n function accumulateLogDerivativeLookupRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Transcript memory tp,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n Fr write_term;\\n Fr read_term;\\n\\n // Calculate the write term (the table accumulation)\\n {\\n write_term = wire(p, WIRE.TABLE_1) + tp.gamma + (wire(p, WIRE.TABLE_2) * tp.eta)\\n + (wire(p, WIRE.TABLE_3) * tp.etaTwo) + (wire(p, WIRE.TABLE_4) * tp.etaThree);\\n }\\n\\n // Calculate the write term\\n {\\n Fr derived_entry_1 = wire(p, WIRE.W_L) + tp.gamma + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_L_SHIFT));\\n Fr derived_entry_2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_M) * wire(p, WIRE.W_R_SHIFT);\\n Fr derived_entry_3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_C) * wire(p, WIRE.W_O_SHIFT);\\n\\n read_term = derived_entry_1 + (derived_entry_2 * tp.eta) + (derived_entry_3 * tp.etaTwo)\\n + (wire(p, WIRE.Q_O) * tp.etaThree);\\n }\\n\\n Fr read_inverse = wire(p, WIRE.LOOKUP_INVERSES) * write_term;\\n Fr write_inverse = wire(p, WIRE.LOOKUP_INVERSES) * read_term;\\n\\n Fr inverse_exists_xor = wire(p, WIRE.LOOKUP_READ_TAGS) + wire(p, WIRE.Q_LOOKUP)\\n - (wire(p, WIRE.LOOKUP_READ_TAGS) * wire(p, WIRE.Q_LOOKUP));\\n\\n // Inverse calculated correctly relation\\n Fr accumulatorNone = read_term * write_term * wire(p, WIRE.LOOKUP_INVERSES) - inverse_exists_xor;\\n accumulatorNone = accumulatorNone * domainSep;\\n\\n // Inverse\\n Fr accumulatorOne = wire(p, WIRE.Q_LOOKUP) * read_inverse - wire(p, WIRE.LOOKUP_READ_COUNTS) * write_inverse;\\n\\n evals[4] = accumulatorNone;\\n evals[5] = accumulatorOne;\\n }\\n\\n function accumulateDeltaRangeRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n Fr minus_one = Fr.wrap(0) - Fr.wrap(1);\\n Fr minus_two = Fr.wrap(0) - Fr.wrap(2);\\n Fr minus_three = Fr.wrap(0) - Fr.wrap(3);\\n\\n // Compute wire differences\\n Fr delta_1 = wire(p, WIRE.W_R) - wire(p, WIRE.W_L);\\n Fr delta_2 = wire(p, WIRE.W_O) - wire(p, WIRE.W_R);\\n Fr delta_3 = wire(p, WIRE.W_4) - wire(p, WIRE.W_O);\\n Fr delta_4 = wire(p, WIRE.W_L_SHIFT) - wire(p, WIRE.W_4);\\n\\n // Contribution 6\\n {\\n Fr acc = delta_1;\\n acc = acc * (delta_1 + minus_one);\\n acc = acc * (delta_1 + minus_two);\\n acc = acc * (delta_1 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[6] = acc;\\n }\\n\\n // Contribution 7\\n {\\n Fr acc = delta_2;\\n acc = acc * (delta_2 + minus_one);\\n acc = acc * (delta_2 + minus_two);\\n acc = acc * (delta_2 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[7] = acc;\\n }\\n\\n // Contribution 8\\n {\\n Fr acc = delta_3;\\n acc = acc * (delta_3 + minus_one);\\n acc = acc * (delta_3 + minus_two);\\n acc = acc * (delta_3 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[8] = acc;\\n }\\n\\n // Contribution 9\\n {\\n Fr acc = delta_4;\\n acc = acc * (delta_4 + minus_one);\\n acc = acc * (delta_4 + minus_two);\\n acc = acc * (delta_4 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[9] = acc;\\n }\\n }\\n\\n struct EllipticParams {\\n // Points\\n Fr x_1;\\n Fr y_1;\\n Fr x_2;\\n Fr y_2;\\n Fr y_3;\\n Fr x_3;\\n // push accumulators into memory\\n Fr x_double_identity;\\n }\\n\\n function accumulateEllipticRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n EllipticParams memory ep;\\n ep.x_1 = wire(p, WIRE.W_R);\\n ep.y_1 = wire(p, WIRE.W_O);\\n\\n ep.x_2 = wire(p, WIRE.W_L_SHIFT);\\n ep.y_2 = wire(p, WIRE.W_4_SHIFT);\\n ep.y_3 = wire(p, WIRE.W_O_SHIFT);\\n ep.x_3 = wire(p, WIRE.W_R_SHIFT);\\n\\n Fr q_sign = wire(p, WIRE.Q_L);\\n Fr q_is_double = wire(p, WIRE.Q_M);\\n\\n // Contribution 10 point addition, x-coordinate check\\n // q_elliptic * (x3 + x2 + x1)(x2 - x1)(x2 - x1) - y2^2 - y1^2 + 2(y2y1)*q_sign = 0\\n Fr x_diff = (ep.x_2 - ep.x_1);\\n Fr y1_sqr = (ep.y_1 * ep.y_1);\\n {\\n // Move to top\\n Fr partialEval = domainSep;\\n\\n Fr y2_sqr = (ep.y_2 * ep.y_2);\\n Fr y1y2 = ep.y_1 * ep.y_2 * q_sign;\\n Fr x_add_identity = (ep.x_3 + ep.x_2 + ep.x_1);\\n x_add_identity = x_add_identity * x_diff * x_diff;\\n x_add_identity = x_add_identity - y2_sqr - y1_sqr + y1y2 + y1y2;\\n\\n evals[10] = x_add_identity * partialEval * wire(p, WIRE.Q_ELLIPTIC) * (Fr.wrap(1) - q_is_double);\\n }\\n\\n // Contribution 11 point addition, x-coordinate check\\n // q_elliptic * (q_sign * y1 + y3)(x2 - x1) + (x3 - x1)(y2 - q_sign * y1) = 0\\n {\\n Fr y1_plus_y3 = ep.y_1 + ep.y_3;\\n Fr y_diff = ep.y_2 * q_sign - ep.y_1;\\n Fr y_add_identity = y1_plus_y3 * x_diff + (ep.x_3 - ep.x_1) * y_diff;\\n evals[11] = y_add_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * (Fr.wrap(1) - q_is_double);\\n }\\n\\n // Contribution 10 point doubling, x-coordinate check\\n // (x3 + x1 + x1) (4y1*y1) - 9 * x1 * x1 * x1 * x1 = 0\\n // N.B. we're using the equivalence x1*x1*x1 === y1*y1 - curve_b to reduce degree by 1\\n {\\n Fr x_pow_4 = (y1_sqr + GRUMPKIN_CURVE_B_PARAMETER_NEGATED) * ep.x_1;\\n Fr y1_sqr_mul_4 = y1_sqr + y1_sqr;\\n y1_sqr_mul_4 = y1_sqr_mul_4 + y1_sqr_mul_4;\\n Fr x1_pow_4_mul_9 = x_pow_4 * Fr.wrap(9);\\n\\n // NOTE: pushed into memory (stack >:'( )\\n ep.x_double_identity = (ep.x_3 + ep.x_1 + ep.x_1) * y1_sqr_mul_4 - x1_pow_4_mul_9;\\n\\n Fr acc = ep.x_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;\\n evals[10] = evals[10] + acc;\\n }\\n\\n // Contribution 11 point doubling, y-coordinate check\\n // (y1 + y1) (2y1) - (3 * x1 * x1)(x1 - x3) = 0\\n {\\n Fr x1_sqr_mul_3 = (ep.x_1 + ep.x_1 + ep.x_1) * ep.x_1;\\n Fr y_double_identity = x1_sqr_mul_3 * (ep.x_1 - ep.x_3) - (ep.y_1 + ep.y_1) * (ep.y_1 + ep.y_3);\\n evals[11] = evals[11] + y_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;\\n }\\n }\\n\\n // Constants for the auxiliary relation\\n Fr constant LIMB_SIZE = Fr.wrap(uint256(1) << 68);\\n Fr constant SUBLIMB_SHIFT = Fr.wrap(uint256(1) << 14);\\n\\n // Parameters used within the Auxiliary Relation\\n // A struct is used to work around stack too deep. This relation has alot of variables\\n struct AuxParams {\\n Fr limb_subproduct;\\n Fr non_native_field_gate_1;\\n Fr non_native_field_gate_2;\\n Fr non_native_field_gate_3;\\n Fr limb_accumulator_1;\\n Fr limb_accumulator_2;\\n Fr memory_record_check;\\n Fr partial_record_check;\\n Fr next_gate_access_type;\\n Fr record_delta;\\n Fr index_delta;\\n Fr adjacent_values_match_if_adjacent_indices_match;\\n Fr adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation;\\n Fr access_check;\\n Fr next_gate_access_type_is_boolean;\\n Fr ROM_consistency_check_identity;\\n Fr RAM_consistency_check_identity;\\n Fr timestamp_delta;\\n Fr RAM_timestamp_check_identity;\\n Fr memory_identity;\\n Fr index_is_monotonically_increasing;\\n Fr auxiliary_identity;\\n }\\n\\n function accumulateAuxillaryRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Transcript memory tp,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n AuxParams memory ap;\\n\\n /**\\n * Contribution 12\\n * Non native field arithmetic gate 2\\n * deg 4\\n *\\n * _ _\\n * / _ _ _ 14 \\\\\\n * q_2 . q_4 | (w_1 . w_2) + (w_1 . w_2) + (w_1 . w_4 + w_2 . w_3 - w_3) . 2 - w_3 - w_4 |\\n * \\\\_ _/\\n *\\n *\\n */\\n ap.limb_subproduct = wire(p, WIRE.W_L) * wire(p, WIRE.W_R_SHIFT) + wire(p, WIRE.W_L_SHIFT) * wire(p, WIRE.W_R);\\n ap.non_native_field_gate_2 =\\n (wire(p, WIRE.W_L) * wire(p, WIRE.W_4) + wire(p, WIRE.W_R) * wire(p, WIRE.W_O) - wire(p, WIRE.W_O_SHIFT));\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 * LIMB_SIZE;\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 - wire(p, WIRE.W_4_SHIFT);\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 + ap.limb_subproduct;\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 * wire(p, WIRE.Q_4);\\n\\n ap.limb_subproduct = ap.limb_subproduct * LIMB_SIZE;\\n ap.limb_subproduct = ap.limb_subproduct + (wire(p, WIRE.W_L_SHIFT) * wire(p, WIRE.W_R_SHIFT));\\n ap.non_native_field_gate_1 = ap.limb_subproduct;\\n ap.non_native_field_gate_1 = ap.non_native_field_gate_1 - (wire(p, WIRE.W_O) + wire(p, WIRE.W_4));\\n ap.non_native_field_gate_1 = ap.non_native_field_gate_1 * wire(p, WIRE.Q_O);\\n\\n ap.non_native_field_gate_3 = ap.limb_subproduct;\\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 + wire(p, WIRE.W_4);\\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 - (wire(p, WIRE.W_O_SHIFT) + wire(p, WIRE.W_4_SHIFT));\\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 * wire(p, WIRE.Q_M);\\n\\n Fr non_native_field_identity =\\n ap.non_native_field_gate_1 + ap.non_native_field_gate_2 + ap.non_native_field_gate_3;\\n non_native_field_identity = non_native_field_identity * wire(p, WIRE.Q_R);\\n\\n // ((((w2' * 2^14 + w1') * 2^14 + w3) * 2^14 + w2) * 2^14 + w1 - w4) * qm\\n // deg 2\\n ap.limb_accumulator_1 = wire(p, WIRE.W_R_SHIFT) * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_L_SHIFT);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_O);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_R);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_L);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 - wire(p, WIRE.W_4);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * wire(p, WIRE.Q_4);\\n\\n // ((((w3' * 2^14 + w2') * 2^14 + w1') * 2^14 + w4) * 2^14 + w3 - w4') * qm\\n // deg 2\\n ap.limb_accumulator_2 = wire(p, WIRE.W_O_SHIFT) * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_R_SHIFT);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_L_SHIFT);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_4);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_O);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 - wire(p, WIRE.W_4_SHIFT);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * wire(p, WIRE.Q_M);\\n\\n Fr limb_accumulator_identity = ap.limb_accumulator_1 + ap.limb_accumulator_2;\\n limb_accumulator_identity = limb_accumulator_identity * wire(p, WIRE.Q_O); // deg 3\\n\\n /**\\n * MEMORY\\n *\\n * A RAM memory record contains a tuple of the following fields:\\n * * i: `index` of memory cell being accessed\\n * * t: `timestamp` of memory cell being accessed (used for RAM, set to 0 for ROM)\\n * * v: `value` of memory cell being accessed\\n * * a: `access` type of record. read: 0 = read, 1 = write\\n * * r: `record` of memory cell. record = access + index * eta + timestamp * eta_two + value * eta_three\\n *\\n * A ROM memory record contains a tuple of the following fields:\\n * * i: `index` of memory cell being accessed\\n * * v: `value1` of memory cell being accessed (ROM tables can store up to 2 values per index)\\n * * v2:`value2` of memory cell being accessed (ROM tables can store up to 2 values per index)\\n * * r: `record` of memory cell. record = index * eta + value2 * eta_two + value1 * eta_three\\n *\\n * When performing a read/write access, the values of i, t, v, v2, a, r are stored in the following wires +\\n * selectors, depending on whether the gate is a RAM read/write or a ROM read\\n *\\n * | gate type | i | v2/t | v | a | r |\\n * | --------- | -- | ----- | -- | -- | -- |\\n * | ROM | w1 | w2 | w3 | -- | w4 |\\n * | RAM | w1 | w2 | w3 | qc | w4 |\\n *\\n * (for accesses where `index` is a circuit constant, it is assumed the circuit will apply a copy constraint on\\n * `w2` to fix its value)\\n *\\n *\\n */\\n\\n /**\\n * Memory Record Check\\n * Partial degree: 1\\n * Total degree: 4\\n *\\n * A ROM/ROM access gate can be evaluated with the identity:\\n *\\n * qc + w1 \\\\eta + w2 \\\\eta_two + w3 \\\\eta_three - w4 = 0\\n *\\n * For ROM gates, qc = 0\\n */\\n ap.memory_record_check = wire(p, WIRE.W_O) * tp.etaThree;\\n ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_R) * tp.etaTwo);\\n ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_L) * tp.eta);\\n ap.memory_record_check = ap.memory_record_check + wire(p, WIRE.Q_C);\\n ap.partial_record_check = ap.memory_record_check; // used in RAM consistency check; deg 1 or 4\\n ap.memory_record_check = ap.memory_record_check - wire(p, WIRE.W_4);\\n\\n /**\\n * Contribution 13 & 14\\n * ROM Consistency Check\\n * Partial degree: 1\\n * Total degree: 4\\n *\\n * For every ROM read, a set equivalence check is applied between the record witnesses, and a second set of\\n * records that are sorted.\\n *\\n * We apply the following checks for the sorted records:\\n *\\n * 1. w1, w2, w3 correctly map to 'index', 'v1, 'v2' for a given record value at w4\\n * 2. index values for adjacent records are monotonically increasing\\n * 3. if, at gate i, index_i == index_{i + 1}, then value1_i == value1_{i + 1} and value2_i == value2_{i + 1}\\n *\\n */\\n ap.index_delta = wire(p, WIRE.W_L_SHIFT) - wire(p, WIRE.W_L);\\n ap.record_delta = wire(p, WIRE.W_4_SHIFT) - wire(p, WIRE.W_4);\\n\\n ap.index_is_monotonically_increasing = ap.index_delta * ap.index_delta - ap.index_delta; // deg 2\\n\\n ap.adjacent_values_match_if_adjacent_indices_match = (ap.index_delta * MINUS_ONE + Fr.wrap(1)) * ap.record_delta; // deg 2\\n\\n evals[13] = ap.adjacent_values_match_if_adjacent_indices_match * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))\\n * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5\\n evals[14] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))\\n * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5\\n\\n ap.ROM_consistency_check_identity = ap.memory_record_check * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R)); // deg 3 or 7\\n\\n /**\\n * Contributions 15,16,17\\n * RAM Consistency Check\\n *\\n * The 'access' type of the record is extracted with the expression `w_4 - ap.partial_record_check`\\n * (i.e. for an honest Prover `w1 * eta + w2 * eta^2 + w3 * eta^3 - w4 = access`.\\n * This is validated by requiring `access` to be boolean\\n *\\n * For two adjacent entries in the sorted list if _both_\\n * A) index values match\\n * B) adjacent access value is 0 (i.e. next gate is a READ)\\n * then\\n * C) both values must match.\\n * The gate boolean check is\\n * (A && B) => C === !(A && B) || C === !A || !B || C\\n *\\n * N.B. it is the responsibility of the circuit writer to ensure that every RAM cell is initialized\\n * with a WRITE operation.\\n */\\n Fr access_type = (wire(p, WIRE.W_4) - ap.partial_record_check); // will be 0 or 1 for honest Prover; deg 1 or 4\\n ap.access_check = access_type * access_type - access_type; // check value is 0 or 1; deg 2 or 8\\n\\n ap.next_gate_access_type = wire(p, WIRE.W_O_SHIFT) * tp.etaThree;\\n ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_R_SHIFT) * tp.etaTwo);\\n ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_L_SHIFT) * tp.eta);\\n ap.next_gate_access_type = wire(p, WIRE.W_4_SHIFT) - ap.next_gate_access_type;\\n\\n Fr value_delta = wire(p, WIRE.W_O_SHIFT) - wire(p, WIRE.W_O);\\n ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation = (\\n ap.index_delta * MINUS_ONE + Fr.wrap(1)\\n ) * value_delta * (ap.next_gate_access_type * MINUS_ONE + Fr.wrap(1)); // deg 3 or 6\\n\\n // We can't apply the RAM consistency check identity on the final entry in the sorted list (the wires in the\\n // next gate would make the identity fail). We need to validate that its 'access type' bool is correct. Can't\\n // do with an arithmetic gate because of the `eta` factors. We need to check that the *next* gate's access\\n // type is correct, to cover this edge case\\n // deg 2 or 4\\n ap.next_gate_access_type_is_boolean =\\n ap.next_gate_access_type * ap.next_gate_access_type - ap.next_gate_access_type;\\n\\n // Putting it all together...\\n evals[15] = ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation\\n * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5 or 8\\n evals[16] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4\\n evals[17] = ap.next_gate_access_type_is_boolean * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4 or 6\\n\\n ap.RAM_consistency_check_identity = ap.access_check * (wire(p, WIRE.Q_ARITH)); // deg 3 or 9\\n\\n /**\\n * RAM Timestamp Consistency Check\\n *\\n * | w1 | w2 | w3 | w4 |\\n * | index | timestamp | timestamp_check | -- |\\n *\\n * Let delta_index = index_{i + 1} - index_{i}\\n *\\n * Iff delta_index == 0, timestamp_check = timestamp_{i + 1} - timestamp_i\\n * Else timestamp_check = 0\\n */\\n ap.timestamp_delta = wire(p, WIRE.W_R_SHIFT) - wire(p, WIRE.W_R);\\n ap.RAM_timestamp_check_identity =\\n (ap.index_delta * MINUS_ONE + Fr.wrap(1)) * ap.timestamp_delta - wire(p, WIRE.W_O); // deg 3\\n\\n /**\\n * Complete Contribution 12\\n * The complete RAM/ROM memory identity\\n * Partial degree:\\n */\\n ap.memory_identity = ap.ROM_consistency_check_identity; // deg 3 or 6\\n ap.memory_identity =\\n ap.memory_identity + ap.RAM_timestamp_check_identity * (wire(p, WIRE.Q_4) * wire(p, WIRE.Q_L)); // deg 4\\n ap.memory_identity = ap.memory_identity + ap.memory_record_check * (wire(p, WIRE.Q_M) * wire(p, WIRE.Q_L)); // deg 3 or 6\\n ap.memory_identity = ap.memory_identity + ap.RAM_consistency_check_identity; // deg 3 or 9\\n\\n // (deg 3 or 9) + (deg 4) + (deg 3)\\n ap.auxiliary_identity = ap.memory_identity + non_native_field_identity + limb_accumulator_identity;\\n ap.auxiliary_identity = ap.auxiliary_identity * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4 or 10\\n evals[12] = ap.auxiliary_identity;\\n }\\n\\n struct PoseidonExternalParams {\\n Fr s1;\\n Fr s2;\\n Fr s3;\\n Fr s4;\\n Fr u1;\\n Fr u2;\\n Fr u3;\\n Fr u4;\\n Fr t0;\\n Fr t1;\\n Fr t2;\\n Fr t3;\\n Fr v1;\\n Fr v2;\\n Fr v3;\\n Fr v4;\\n Fr q_pos_by_scaling;\\n }\\n\\n function accumulatePoseidonExternalRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n PoseidonExternalParams memory ep;\\n\\n ep.s1 = wire(p, WIRE.W_L) + wire(p, WIRE.Q_L);\\n ep.s2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_R);\\n ep.s3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_O);\\n ep.s4 = wire(p, WIRE.W_4) + wire(p, WIRE.Q_4);\\n\\n ep.u1 = ep.s1 * ep.s1 * ep.s1 * ep.s1 * ep.s1;\\n ep.u2 = ep.s2 * ep.s2 * ep.s2 * ep.s2 * ep.s2;\\n ep.u3 = ep.s3 * ep.s3 * ep.s3 * ep.s3 * ep.s3;\\n ep.u4 = ep.s4 * ep.s4 * ep.s4 * ep.s4 * ep.s4;\\n // matrix mul v = M_E * u with 14 additions\\n ep.t0 = ep.u1 + ep.u2; // u_1 + u_2\\n ep.t1 = ep.u3 + ep.u4; // u_3 + u_4\\n ep.t2 = ep.u2 + ep.u2 + ep.t1; // 2u_2\\n // ep.t2 += ep.t1; // 2u_2 + u_3 + u_4\\n ep.t3 = ep.u4 + ep.u4 + ep.t0; // 2u_4\\n // ep.t3 += ep.t0; // u_1 + u_2 + 2u_4\\n ep.v4 = ep.t1 + ep.t1;\\n ep.v4 = ep.v4 + ep.v4 + ep.t3;\\n // ep.v4 += ep.t3; // u_1 + u_2 + 4u_3 + 6u_4\\n ep.v2 = ep.t0 + ep.t0;\\n ep.v2 = ep.v2 + ep.v2 + ep.t2;\\n // ep.v2 += ep.t2; // 4u_1 + 6u_2 + u_3 + u_4\\n ep.v1 = ep.t3 + ep.v2; // 5u_1 + 7u_2 + u_3 + 3u_4\\n ep.v3 = ep.t2 + ep.v4; // u_1 + 3u_2 + 5u_3 + 7u_4\\n\\n ep.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_EXTERNAL) * domainSep;\\n evals[18] = evals[18] + ep.q_pos_by_scaling * (ep.v1 - wire(p, WIRE.W_L_SHIFT));\\n\\n evals[19] = evals[19] + ep.q_pos_by_scaling * (ep.v2 - wire(p, WIRE.W_R_SHIFT));\\n\\n evals[20] = evals[20] + ep.q_pos_by_scaling * (ep.v3 - wire(p, WIRE.W_O_SHIFT));\\n\\n evals[21] = evals[21] + ep.q_pos_by_scaling * (ep.v4 - wire(p, WIRE.W_4_SHIFT));\\n }\\n\\n struct PoseidonInternalParams {\\n Fr u1;\\n Fr u2;\\n Fr u3;\\n Fr u4;\\n Fr u_sum;\\n Fr v1;\\n Fr v2;\\n Fr v3;\\n Fr v4;\\n Fr s1;\\n Fr q_pos_by_scaling;\\n }\\n\\n function accumulatePoseidonInternalRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n PoseidonInternalParams memory ip;\\n\\n Fr[4] memory INTERNAL_MATRIX_DIAGONAL = [\\n FrLib.from(0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e7),\\n FrLib.from(0x0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b),\\n FrLib.from(0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac15),\\n FrLib.from(0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b)\\n ];\\n\\n // add round constants\\n ip.s1 = wire(p, WIRE.W_L) + wire(p, WIRE.Q_L);\\n\\n // apply s-box round\\n ip.u1 = ip.s1 * ip.s1 * ip.s1 * ip.s1 * ip.s1;\\n ip.u2 = wire(p, WIRE.W_R);\\n ip.u3 = wire(p, WIRE.W_O);\\n ip.u4 = wire(p, WIRE.W_4);\\n\\n // matrix mul with v = M_I * u 4 muls and 7 additions\\n ip.u_sum = ip.u1 + ip.u2 + ip.u3 + ip.u4;\\n\\n ip.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_INTERNAL) * domainSep;\\n\\n ip.v1 = ip.u1 * INTERNAL_MATRIX_DIAGONAL[0] + ip.u_sum;\\n evals[22] = evals[22] + ip.q_pos_by_scaling * (ip.v1 - wire(p, WIRE.W_L_SHIFT));\\n\\n ip.v2 = ip.u2 * INTERNAL_MATRIX_DIAGONAL[1] + ip.u_sum;\\n evals[23] = evals[23] + ip.q_pos_by_scaling * (ip.v2 - wire(p, WIRE.W_R_SHIFT));\\n\\n ip.v3 = ip.u3 * INTERNAL_MATRIX_DIAGONAL[2] + ip.u_sum;\\n evals[24] = evals[24] + ip.q_pos_by_scaling * (ip.v3 - wire(p, WIRE.W_O_SHIFT));\\n\\n ip.v4 = ip.u4 * INTERNAL_MATRIX_DIAGONAL[3] + ip.u_sum;\\n evals[25] = evals[25] + ip.q_pos_by_scaling * (ip.v4 - wire(p, WIRE.W_4_SHIFT));\\n }\\n\\n function scaleAndBatchSubrelations(\\n Fr[NUMBER_OF_SUBRELATIONS] memory evaluations,\\n Fr[NUMBER_OF_ALPHAS] memory subrelationChallenges\\n ) internal pure returns (Fr accumulator) {\\n accumulator = accumulator + evaluations[0];\\n\\n for (uint256 i = 1; i < NUMBER_OF_SUBRELATIONS; ++i) {\\n accumulator = accumulator + evaluations[i] * subrelationChallenges[i - 1];\\n }\\n }\\n}\\n\\n// Errors\\nerror PublicInputsLengthWrong();\\nerror SumcheckFailed();\\nerror ShpleminiFailed();\\n\\ninterface IVerifier {\\n function verify(bytes calldata _proof, bytes32[] calldata _publicInputs) external view returns (bool);\\n}\\n\\n// Smart contract verifier of honk proofs\\ncontract HonkVerifier is IVerifier\\n{\\n using FrLib for Fr;\\n\\n function verify(bytes calldata proof, bytes32[] calldata publicInputs) public view override returns (bool) {\\n Honk.VerificationKey memory vk = loadVerificationKey();\\n Honk.Proof memory p = TranscriptLib.loadProof(proof);\\n\\n if (publicInputs.length != vk.publicInputsSize) {\\n revert PublicInputsLengthWrong();\\n }\\n\\n // Generate the fiat shamir challenges for the whole protocol\\n Transcript memory t = TranscriptLib.generateTranscript(p, publicInputs, vk.publicInputsSize);\\n\\n // Compute the public input delta\\n t.publicInputsDelta =\\n computePublicInputDelta(publicInputs, t.beta, t.gamma, vk.circuitSize, p.publicInputsOffset);\\n\\n // Sumcheck\\n bool sumcheckVerified = verifySumcheck(p, t);\\n if (!sumcheckVerified) revert SumcheckFailed();\\n\\n bool shpleminiVerified = verifyShplemini(p, vk, t);\\n if (!shpleminiVerified) revert ShpleminiFailed();\\n\\n return sumcheckVerified && shpleminiVerified; // Boolean condition not required - nice for vanity :)\\n }\\n\\n function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) {\\n return HonkVerificationKey.loadVerificationKey();\\n }\\n\\n function computePublicInputDelta(\\n bytes32[] memory publicInputs,\\n Fr beta,\\n Fr gamma,\\n uint256 domainSize,\\n uint256 offset\\n ) internal view returns (Fr publicInputDelta) {\\n Fr numerator = Fr.wrap(1);\\n Fr denominator = Fr.wrap(1);\\n\\n Fr numeratorAcc = gamma + (beta * FrLib.from(domainSize + offset));\\n Fr denominatorAcc = gamma - (beta * FrLib.from(offset + 1));\\n\\n {\\n for (uint256 i = 0; i < NUMBER_OF_PUBLIC_INPUTS; i++) {\\n Fr pubInput = FrLib.fromBytes32(publicInputs[i]);\\n\\n numerator = numerator * (numeratorAcc + pubInput);\\n denominator = denominator * (denominatorAcc + pubInput);\\n\\n numeratorAcc = numeratorAcc + beta;\\n denominatorAcc = denominatorAcc - beta;\\n }\\n }\\n\\n // Fr delta = numerator / denominator; // TOOO: batch invert later?\\n publicInputDelta = FrLib.div(numerator, denominator);\\n }\\n\\n uint256 constant ROUND_TARGET = 0;\\n\\n function verifySumcheck(Honk.Proof memory proof, Transcript memory tp) internal view returns (bool verified) {\\n Fr roundTarget;\\n Fr powPartialEvaluation = Fr.wrap(1);\\n\\n // We perform sumcheck reductions over log n rounds ( the multivariate degree )\\n for (uint256 round; round < LOG_N; ++round) {\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariate = proof.sumcheckUnivariates[round];\\n bool valid = checkSum(roundUnivariate, roundTarget);\\n if (!valid) revert SumcheckFailed();\\n\\n Fr roundChallenge = tp.sumCheckUChallenges[round];\\n\\n // Update the round target for the next rounf\\n roundTarget = computeNextTargetSum(roundUnivariate, roundChallenge);\\n powPartialEvaluation = partiallyEvaluatePOW(tp, powPartialEvaluation, roundChallenge, round);\\n }\\n\\n // Last round\\n Fr grandHonkRelationSum = RelationsLib.accumulateRelationEvaluations(proof, tp, powPartialEvaluation);\\n verified = (grandHonkRelationSum == roundTarget);\\n }\\n\\n function checkSum(Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariate, Fr roundTarget)\\n internal\\n pure\\n returns (bool checked)\\n {\\n Fr totalSum = roundUnivariate[0] + roundUnivariate[1];\\n checked = totalSum == roundTarget;\\n }\\n\\n // Return the new target sum for the next sumcheck round\\n function computeNextTargetSum(Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariates, Fr roundChallenge)\\n internal\\n view\\n returns (Fr targetSum)\\n {\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory BARYCENTRIC_LAGRANGE_DENOMINATORS = [\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffec51),\\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000002d0),\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff11),\\n Fr.wrap(0x0000000000000000000000000000000000000000000000000000000000000090),\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff71),\\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000000f0),\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593effffd31),\\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000013b0)\\n ];\\n\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory BARYCENTRIC_DOMAIN = [\\n Fr.wrap(0x00),\\n Fr.wrap(0x01),\\n Fr.wrap(0x02),\\n Fr.wrap(0x03),\\n Fr.wrap(0x04),\\n Fr.wrap(0x05),\\n Fr.wrap(0x06),\\n Fr.wrap(0x07)\\n ];\\n // To compute the next target sum, we evaluate the given univariate at a point u (challenge).\\n\\n // Performing Barycentric evaluations\\n // Compute B(x)\\n Fr numeratorValue = Fr.wrap(1);\\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\\n numeratorValue = numeratorValue * (roundChallenge - Fr.wrap(i));\\n }\\n\\n // Calculate domain size N of inverses\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory denominatorInverses;\\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\\n Fr inv = BARYCENTRIC_LAGRANGE_DENOMINATORS[i];\\n inv = inv * (roundChallenge - BARYCENTRIC_DOMAIN[i]);\\n inv = FrLib.invert(inv);\\n denominatorInverses[i] = inv;\\n }\\n\\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\\n Fr term = roundUnivariates[i];\\n term = term * denominatorInverses[i];\\n targetSum = targetSum + term;\\n }\\n\\n // Scale the sum by the value of B(x)\\n targetSum = targetSum * numeratorValue;\\n }\\n\\n // Univariate evaluation of the monomial ((1-X_l) + X_l.B_l) at the challenge point X_l=u_l\\n function partiallyEvaluatePOW(Transcript memory tp, Fr currentEvaluation, Fr roundChallenge, uint256 round)\\n internal\\n pure\\n returns (Fr newEvaluation)\\n {\\n Fr univariateEval = Fr.wrap(1) + (roundChallenge * (tp.gateChallenges[round] - Fr.wrap(1)));\\n newEvaluation = currentEvaluation * univariateEval;\\n }\\n\\n // Avoid stack too deep\\n struct ShpleminiIntermediates {\\n // i-th unshifted commitment is multiplied by \\u2212\\u03c1\\u2071 and the unshifted_scalar ( 1/(z\\u2212r) + \\u03bd/(z+r) )\\n Fr unshiftedScalar;\\n // i-th shifted commitment is multiplied by \\u2212\\u03c1\\u2071\\u207a\\u1d4f and the shifted_scalar r\\u207b\\u00b9 \\u22c5 (1/(z\\u2212r) \\u2212 \\u03bd/(z+r))\\n Fr shiftedScalar;\\n // Scalar to be multiplied by [1]\\u2081\\n Fr constantTermAccumulator;\\n // Accumulator for powers of rho\\n Fr batchingChallenge;\\n // Linear combination of multilinear (sumcheck) evaluations and powers of rho\\n Fr batchedEvaluation;\\n }\\n\\n function verifyShplemini(Honk.Proof memory proof, Honk.VerificationKey memory vk, Transcript memory tp)\\n internal\\n view\\n returns (bool verified)\\n {\\n ShpleminiIntermediates memory mem; // stack\\n\\n // - Compute vector (r, r\\u00b2, ... , r\\u00b2\\u207d\\u207f\\u207b\\u00b9\\u207e), where n = log_circuit_size, I think this should be CONST_PROOF_SIZE\\n Fr[CONST_PROOF_SIZE_LOG_N] memory powers_of_evaluation_challenge = computeSquares(tp.geminiR);\\n\\n // Arrays hold values that will be linearly combined for the gemini and shplonk batch openings\\n Fr[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory scalars;\\n Honk.G1Point[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory commitments;\\n\\n Fr[CONST_PROOF_SIZE_LOG_N + 1] memory inverse_vanishing_evals =\\n computeInvertedGeminiDenominators(tp, powers_of_evaluation_challenge);\\n\\n mem.unshiftedScalar = inverse_vanishing_evals[0] + (tp.shplonkNu * inverse_vanishing_evals[1]);\\n mem.shiftedScalar =\\n tp.geminiR.invert() * (inverse_vanishing_evals[0] - (tp.shplonkNu * inverse_vanishing_evals[1]));\\n\\n scalars[0] = Fr.wrap(1);\\n commitments[0] = convertProofPoint(proof.shplonkQ);\\n\\n /* Batch multivariate opening claims, shifted and unshifted\\n * The vector of scalars is populated as follows:\\n * \\\\f[\\n * \\\\left(\\n * - \\\\left(\\\\frac{1}{z-r} + \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right),\\n * \\\\ldots,\\n * - \\\\rho^{i+k-1} \\\\times \\\\left(\\\\frac{1}{z-r} + \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right),\\n * - \\\\rho^{i+k} \\\\times \\\\frac{1}{r} \\\\times \\\\left(\\\\frac{1}{z-r} - \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right),\\n * \\\\ldots,\\n * - \\\\rho^{k+m-1} \\\\times \\\\frac{1}{r} \\\\times \\\\left(\\\\frac{1}{z-r} - \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right)\\n * \\\\right)\\n * \\\\f]\\n *\\n * The following vector is concatenated to the vector of commitments:\\n * \\\\f[\\n * f_0, \\\\ldots, f_{m-1}, f_{\\\\text{shift}, 0}, \\\\ldots, f_{\\\\text{shift}, k-1}\\n * \\\\f]\\n *\\n * Simultaneously, the evaluation of the multilinear polynomial\\n * \\\\f[\\n * \\\\sum \\\\rho^i \\\\cdot f_i + \\\\sum \\\\rho^{i+k} \\\\cdot f_{\\\\text{shift}, i}\\n * \\\\f]\\n * at the challenge point \\\\f$ (u_0,\\\\ldots, u_{n-1}) \\\\f$ is computed.\\n *\\n * This approach minimizes the number of iterations over the commitments to multilinear polynomials\\n * and eliminates the need to store the powers of \\\\f$ \\\\rho \\\\f$.\\n */\\n mem.batchingChallenge = Fr.wrap(1);\\n mem.batchedEvaluation = Fr.wrap(0);\\n\\n for (uint256 i = 1; i <= NUMBER_UNSHIFTED; ++i) {\\n scalars[i] = mem.unshiftedScalar.neg() * mem.batchingChallenge;\\n mem.batchedEvaluation = mem.batchedEvaluation + (proof.sumcheckEvaluations[i - 1] * mem.batchingChallenge);\\n mem.batchingChallenge = mem.batchingChallenge * tp.rho;\\n }\\n // g commitments are accumulated at r\\n for (uint256 i = NUMBER_UNSHIFTED + 1; i <= NUMBER_OF_ENTITIES; ++i) {\\n scalars[i] = mem.shiftedScalar.neg() * mem.batchingChallenge;\\n mem.batchedEvaluation = mem.batchedEvaluation + (proof.sumcheckEvaluations[i - 1] * mem.batchingChallenge);\\n mem.batchingChallenge = mem.batchingChallenge * tp.rho;\\n }\\n\\n commitments[1] = vk.qm;\\n commitments[2] = vk.qc;\\n commitments[3] = vk.ql;\\n commitments[4] = vk.qr;\\n commitments[5] = vk.qo;\\n commitments[6] = vk.q4;\\n commitments[7] = vk.qArith;\\n commitments[8] = vk.qDeltaRange;\\n commitments[9] = vk.qElliptic;\\n commitments[10] = vk.qAux;\\n commitments[11] = vk.qLookup;\\n commitments[12] = vk.qPoseidon2External;\\n commitments[13] = vk.qPoseidon2Internal;\\n commitments[14] = vk.s1;\\n commitments[15] = vk.s2;\\n commitments[16] = vk.s3;\\n commitments[17] = vk.s4;\\n commitments[18] = vk.id1;\\n commitments[19] = vk.id2;\\n commitments[20] = vk.id3;\\n commitments[21] = vk.id4;\\n commitments[22] = vk.t1;\\n commitments[23] = vk.t2;\\n commitments[24] = vk.t3;\\n commitments[25] = vk.t4;\\n commitments[26] = vk.lagrangeFirst;\\n commitments[27] = vk.lagrangeLast;\\n\\n // Accumulate proof points\\n commitments[28] = convertProofPoint(proof.w1);\\n commitments[29] = convertProofPoint(proof.w2);\\n commitments[30] = convertProofPoint(proof.w3);\\n commitments[31] = convertProofPoint(proof.w4);\\n commitments[32] = convertProofPoint(proof.zPerm);\\n commitments[33] = convertProofPoint(proof.lookupInverses);\\n commitments[34] = convertProofPoint(proof.lookupReadCounts);\\n commitments[35] = convertProofPoint(proof.lookupReadTags);\\n\\n // to be Shifted\\n commitments[36] = vk.t1;\\n commitments[37] = vk.t2;\\n commitments[38] = vk.t3;\\n commitments[39] = vk.t4;\\n commitments[40] = convertProofPoint(proof.w1);\\n commitments[41] = convertProofPoint(proof.w2);\\n commitments[42] = convertProofPoint(proof.w3);\\n commitments[43] = convertProofPoint(proof.w4);\\n commitments[44] = convertProofPoint(proof.zPerm);\\n\\n /* Batch gemini claims from the prover\\n * place the commitments to gemini a\\u1d62 to the vector of commitments, compute the contributions from\\n * a\\u1d62(\\u2212r\\u00b2\\u2071) for i=1, \\u2026 , n\\u22121 to the constant term accumulator, add corresponding scalars\\n *\\n * 1. Moves the vector\\n * \\\\f[\\n * \\\\left( \\\\text{com}(A_1), \\\\text{com}(A_2), \\\\ldots, \\\\text{com}(A_{n-1}) \\\\right)\\n * \\\\f]\\n * to the 'commitments' vector.\\n *\\n * 2. Computes the scalars:\\n * \\\\f[\\n * \\\\frac{\\\\nu^{2}}{z + r^2}, \\\\frac{\\\\nu^3}{z + r^4}, \\\\ldots, \\\\frac{\\\\nu^{n-1}}{z + r^{2^{n-1}}}\\n * \\\\f]\\n * and places them into the 'scalars' vector.\\n *\\n * 3. Accumulates the summands of the constant term:\\n * \\\\f[\\n * \\\\sum_{i=2}^{n-1} \\\\frac{\\\\nu^{i} \\\\cdot A_i(-r^{2^i})}{z + r^{2^i}}\\n * \\\\f]\\n * and adds them to the 'constant_term_accumulator'.\\n */\\n mem.constantTermAccumulator = Fr.wrap(0);\\n mem.batchingChallenge = tp.shplonkNu.sqr();\\n\\n for (uint256 i; i < CONST_PROOF_SIZE_LOG_N - 1; ++i) {\\n bool dummy_round = i >= (LOG_N - 1);\\n\\n Fr scalingFactor = Fr.wrap(0);\\n if (!dummy_round) {\\n scalingFactor = mem.batchingChallenge * inverse_vanishing_evals[i + 2];\\n scalars[NUMBER_OF_ENTITIES + 1 + i] = scalingFactor.neg();\\n }\\n\\n mem.constantTermAccumulator =\\n mem.constantTermAccumulator + (scalingFactor * proof.geminiAEvaluations[i + 1]);\\n mem.batchingChallenge = mem.batchingChallenge * tp.shplonkNu;\\n\\n commitments[NUMBER_OF_ENTITIES + 1 + i] = convertProofPoint(proof.geminiFoldComms[i]);\\n }\\n\\n // Add contributions from A\\u2080(r) and A\\u2080(-r) to constant_term_accumulator:\\n // Compute evaluation A\\u2080(r)\\n Fr a_0_pos = computeGeminiBatchedUnivariateEvaluation(\\n tp, mem.batchedEvaluation, proof.geminiAEvaluations, powers_of_evaluation_challenge\\n );\\n\\n mem.constantTermAccumulator = mem.constantTermAccumulator + (a_0_pos * inverse_vanishing_evals[0]);\\n mem.constantTermAccumulator =\\n mem.constantTermAccumulator + (proof.geminiAEvaluations[0] * tp.shplonkNu * inverse_vanishing_evals[1]);\\n\\n // Finalise the batch opening claim\\n commitments[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N] = Honk.G1Point({x: 1, y: 2});\\n scalars[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N] = mem.constantTermAccumulator;\\n\\n Honk.G1Point memory quotient_commitment = convertProofPoint(proof.kzgQuotient);\\n\\n commitments[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 1] = quotient_commitment;\\n scalars[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 1] = tp.shplonkZ; // evaluation challenge\\n\\n Honk.G1Point memory P_0 = batchMul(commitments, scalars);\\n Honk.G1Point memory P_1 = negateInplace(quotient_commitment);\\n\\n return pairing(P_0, P_1);\\n }\\n\\n function computeSquares(Fr r) internal pure returns (Fr[CONST_PROOF_SIZE_LOG_N] memory squares) {\\n squares[0] = r;\\n for (uint256 i = 1; i < CONST_PROOF_SIZE_LOG_N; ++i) {\\n squares[i] = squares[i - 1].sqr();\\n }\\n }\\n\\n function computeInvertedGeminiDenominators(\\n Transcript memory tp,\\n Fr[CONST_PROOF_SIZE_LOG_N] memory eval_challenge_powers\\n ) internal view returns (Fr[CONST_PROOF_SIZE_LOG_N + 1] memory inverse_vanishing_evals) {\\n Fr eval_challenge = tp.shplonkZ;\\n inverse_vanishing_evals[0] = (eval_challenge - eval_challenge_powers[0]).invert();\\n\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; ++i) {\\n Fr round_inverted_denominator = Fr.wrap(0);\\n if (i <= LOG_N + 1) {\\n round_inverted_denominator = (eval_challenge + eval_challenge_powers[i]).invert();\\n }\\n inverse_vanishing_evals[i + 1] = round_inverted_denominator;\\n }\\n }\\n\\n function computeGeminiBatchedUnivariateEvaluation(\\n Transcript memory tp,\\n Fr batchedEvalAccumulator,\\n Fr[CONST_PROOF_SIZE_LOG_N] memory geminiEvaluations,\\n Fr[CONST_PROOF_SIZE_LOG_N] memory geminiEvalChallengePowers\\n ) internal view returns (Fr a_0_pos) {\\n for (uint256 i = CONST_PROOF_SIZE_LOG_N; i > 0; --i) {\\n Fr challengePower = geminiEvalChallengePowers[i - 1];\\n Fr u = tp.sumCheckUChallenges[i - 1];\\n Fr evalNeg = geminiEvaluations[i - 1];\\n\\n Fr batchedEvalRoundAcc = (\\n (challengePower * batchedEvalAccumulator * Fr.wrap(2))\\n - evalNeg * (challengePower * (Fr.wrap(1) - u) - u)\\n );\\n // Divide by the denominator\\n batchedEvalRoundAcc = batchedEvalRoundAcc * (challengePower * (Fr.wrap(1) - u) + u).invert();\\n\\n bool is_dummy_round = (i > LOG_N);\\n if (!is_dummy_round) {\\n batchedEvalAccumulator = batchedEvalRoundAcc;\\n }\\n }\\n\\n a_0_pos = batchedEvalAccumulator;\\n }\\n\\n // This implementation is the same as above with different constants\\n function batchMul(\\n Honk.G1Point[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory base,\\n Fr[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory scalars\\n ) internal view returns (Honk.G1Point memory result) {\\n uint256 limit = NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2;\\n assembly {\\n let success := 0x01\\n let free := mload(0x40)\\n\\n // Write the original into the accumulator\\n // Load into memory for ecMUL, leave offset for eccAdd result\\n // base is an array of pointers, so we have to dereference them\\n mstore(add(free, 0x40), mload(mload(base)))\\n mstore(add(free, 0x60), mload(add(0x20, mload(base))))\\n // Add scalar\\n mstore(add(free, 0x80), mload(scalars))\\n success := and(success, staticcall(gas(), 7, add(free, 0x40), 0x60, free, 0x40))\\n\\n let count := 0x01\\n for {} lt(count, limit) { count := add(count, 1) } {\\n // Get loop offsets\\n let base_base := add(base, mul(count, 0x20))\\n let scalar_base := add(scalars, mul(count, 0x20))\\n\\n mstore(add(free, 0x40), mload(mload(base_base)))\\n mstore(add(free, 0x60), mload(add(0x20, mload(base_base))))\\n // Add scalar\\n mstore(add(free, 0x80), mload(scalar_base))\\n\\n success := and(success, staticcall(gas(), 7, add(free, 0x40), 0x60, add(free, 0x40), 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, free, 0x80, free, 0x40))\\n }\\n\\n // Return the result - i hate this\\n mstore(result, mload(free))\\n mstore(add(result, 0x20), mload(add(free, 0x20)))\\n }\\n }\\n\\n function pairing(Honk.G1Point memory rhs, Honk.G1Point memory lhs) internal view returns (bool) {\\n bytes memory input = abi.encodePacked(\\n rhs.x,\\n rhs.y,\\n // Fixed G1 point\\n uint256(0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2),\\n uint256(0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed),\\n uint256(0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b),\\n uint256(0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa),\\n lhs.x,\\n lhs.y,\\n // G1 point from VK\\n uint256(0x260e01b251f6f1c7e7ff4e580791dee8ea51d87a358e038b4efe30fac09383c1),\\n uint256(0x0118c4d5b837bcc2bc89b5b398b5974e9f5944073b32078b7e231fec938883b0),\\n uint256(0x04fc6369f7110fe3d25156c1bb9a72859cf2a04641f99ba4ee413c80da6a5fe4),\\n uint256(0x22febda3c0c0632a56475b4214e5615e11e6dd3f96e6cea2854a87d4dacc5e55)\\n );\\n\\n (bool success, bytes memory result) = address(0x08).staticcall(input);\\n bool decodedResult = abi.decode(result, (bool));\\n return success && decodedResult;\\n }\\n}\\n\\n// Conversion util - Duplicated as we cannot template LOG_N\\nfunction convertPoints(Honk.G1ProofPoint[LOG_N + 1] memory commitments)\\n pure\\n returns (Honk.G1Point[LOG_N + 1] memory converted)\\n{\\n for (uint256 i; i < LOG_N + 1; ++i) {\\n converted[i] = convertProofPoint(commitments[i]);\\n }\\n}\\n\\n\",\"keccak256\":\"0x53b6264c492aa965c64cb7ba841634dfd41ab54239d00d2db76b683e62525125\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x6080604052348015600f57600080fd5b50615fd08061001f6000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ea50d0e414610030575b600080fd5b61004361003e366004615ae0565b610057565b604051901515815260200160405180910390f35b6000806100626101b9565b9050600061007087876101ce565b604083015190915084146100b0576040517ffa06659300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006100c28287878660400151610b72565b90506101108686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050506060830151608084015186516040870151610c4d565b61018082015260006101228383610d11565b90508061015b576040517f9fc3a21800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610168848685610deb565b9050806101a1576040517fa5d82e8a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8180156101ab5750805b9a9950505050505050505050565b6101c1615253565b6101c96118f5565b905090565b6101d661560a565b6101de61560a565b6101ec602060008587615bb3565b6101f591615bdd565b8152610205604060208587615bb3565b61020e91615bdd565b6020820152610221606060408587615bb3565b61022a91615bdd565b6040808301919091528051608080820190925290819061024d9060608789615bb3565b61025691615bdd565b815260200161026960a060808789615bb3565b61027291615bdd565b815260200161028560c060a08789615bb3565b61028e91615bdd565b81526020016102a160e060c08789615bb3565b6102aa91615bdd565b905260608201526040805160808101909152806102cc61010060e08789615bb3565b6102d591615bdd565b81526020016102ea6101206101008789615bb3565b6102f391615bdd565b81526020016103086101406101208789615bb3565b61031191615bdd565b81526020016103266101606101408789615bb3565b61032f91615bdd565b9052608080830191909152604080519182019052806103546101806101608789615bb3565b61035d91615bdd565b81526020016103726101a06101808789615bb3565b61037b91615bdd565b81526020016103906101c06101a08789615bb3565b61039991615bdd565b81526020016103ae6101e06101c08789615bb3565b6103b791615bdd565b905260a08201526040805160808101909152806103da6102006101e08789615bb3565b6103e391615bdd565b81526020016103f86102206102008789615bb3565b61040191615bdd565b81526020016104166102406102208789615bb3565b61041f91615bdd565b81526020016104346102606102408789615bb3565b61043d91615bdd565b90526101008201526040805160808101909152806104616102806102608789615bb3565b61046a91615bdd565b815260200161047f6102a06102808789615bb3565b61048891615bdd565b815260200161049d6102c06102a08789615bb3565b6104a691615bdd565b81526020016104bb6102e06102c08789615bb3565b6104c491615bdd565b90526101208201526040805160808101909152806104e86103006102e08789615bb3565b6104f191615bdd565b81526020016105066103206103008789615bb3565b61050f91615bdd565b81526020016105246103406103208789615bb3565b61052d91615bdd565b81526020016105426103606103408789615bb3565b61054b91615bdd565b905260c082015260408051608081019091528061056e6103806103608789615bb3565b61057791615bdd565b815260200161058c6103a06103808789615bb3565b61059591615bdd565b81526020016105aa6103c06103a08789615bb3565b6105b391615bdd565b81526020016105c86103e06103c08789615bb3565b6105d191615bdd565b90526101408201526040805160808101909152806105f56104006103e08789615bb3565b6105fe91615bdd565b81526020016106136104206104008789615bb3565b61061c91615bdd565b81526020016106316104406104208789615bb3565b61063a91615bdd565b815260200161064f6104606104408789615bb3565b61065891615bdd565b905260e082015261046060005b601c81101561072a576000600861067d836020615c48565b6106879190615c48565b6106919084615c5f565b905060005b60088110156107205760006106ac826020615c48565b6106b69084615c5f565b905060006106c5826020615c5f565b90506106e46106d682848c8e615bb3565b6106df91615bdd565b6121d9565b87610160015186601c81106106fb576106fb615c72565b6020020151846008811061071157610711615c72565b60200201525050600101610696565b5050600101610665565b506107376008601c615c48565b610742906020615c48565b61074c9082615c5f565b905060005b602c8110156107b7576000610767826020615c48565b6107719084615c5f565b90506000610780826020615c5f565b90506107916106d682848a8c615bb3565b85610180015184602c81106107a8576107a8615c72565b60200201525050600101610751565b506107c4602c6020615c48565b6107ce9082615c5f565b905060005b6107df6001601c615ca1565b8110156108ff5760006107f3826080615c48565b6107fd9084615c5f565b9050600061080c826020615c5f565b905080600061081c826020615c5f565b905080600061082c826020615c5f565b905080600061083c826020615c5f565b905060405180608001604052808f8f8b908b9261085b93929190615bb3565b61086491615bdd565b60001c81526020018f8f8990899261087e93929190615bb3565b61088791615bdd565b60001c81526020018f8f879087926108a193929190615bb3565b6108aa91615bdd565b60001c81526020018f8f859085926108c493929190615bb3565b6108cd91615bdd565b90526101a08c01518a601b81106108e6576108e6615c72565b60200201525050600190960195506107d3945050505050565b5061090c6001601c615ca1565b610917906080615c48565b6109219082615c5f565b905060005b601c81101561098c57600061093c826020615c48565b6109469084615c5f565b90506000610955826020615c5f565b90506109666106d682848a8c615bb3565b856101c0015184601c811061097d5761097d615c72565b60200201525050600101610926565b50610999601c6020615c48565b6109a39082615c5f565b90506040518060800160405280868684908560206109c19190615c5f565b926109ce93929190615bb3565b6109d791615bdd565b60001c815260200186868460206109ee9190615c5f565b906109fa866040615c5f565b92610a0793929190615bb3565b610a1091615bdd565b81526020018686610a22856040615c5f565b90610a2e866060615c5f565b92610a3b93929190615bb3565b610a4491615bdd565b81526020018686610a56856060615c5f565b90610a62866080615c5f565b92610a6f93929190615bb3565b610a7891615bdd565b90526101e0830152610a8b816080615c5f565b9050604051806080016040528086868490856020610aa99190615c5f565b92610ab693929190615bb3565b610abf91615bdd565b60001c81526020018686846020610ad69190615c5f565b90610ae2866040615c5f565b92610aef93929190615bb3565b610af891615bdd565b81526020018686610b0a856040615c5f565b90610b16866060615c5f565b92610b2393929190615bb3565b610b2c91615bdd565b81526020018686610b3e856060615c5f565b90610b4a866080615c5f565b92610b5793929190615bb3565b610b6091615bdd565b90526102008301525090505b92915050565b610b7a61583a565b6000610b8886868686612205565b604086019190915260208501919091529083529050610ba7818761265c565b608085019190915260608401919091529050610bc38187612731565b60a08401919091529050610bd6816128b1565b60c08401919091529050610bea8682612914565b60e08401919091529050610bfe86826129eb565b6101008401919091529050610c138682612a79565b6101208401919091529050610c288682612be9565b6101408401919091529050610c3d8682612c5d565b5061016083015250949350505050565b600060018082610c7287610c6d8a610c686106df8a8c615c5f565b612cb5565b612ce2565b90506000610c9188610c8c8b610c686106df8b6001615c5f565b612d0f565b905060005b6043811015610d06576000610cc38c8381518110610cb657610cb6615c72565b60200260200101516121d9565b9050610cd386610c688684612ce2565b9550610ce385610c688584612ce2565b9450610cef848c612ce2565b9350610cfb838c612d0f565b925050600101610c96565b506101ab8484612d65565b6000806001815b6012811015610dcd57600086610160015182601c8110610d3a57610d3a615c72565b602002015190506000610d4d8286612d7b565b905080610d86576040517f9fc3a21800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008760e0015184601c8110610d9e57610d9e615c72565b60200201519050610daf8382612d9f565b9550610dbd88868387612fc1565b9450505050806001019050610d18565b506000610ddb868684612ffe565b90508281145b9695505050505050565b6000610e1f6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6000610e2f846101200151613078565b9050610e396158b4565b610e416158d3565b6000610e4d87856130dd565b8051610140890151919250610e6e91610c6d908460015b6020020151612cb5565b8552610120870151610e9c90610e8390613170565b82516101408a0151610c689190610c8c90866001610e64565b602086810191909152600184526101e08a015160408051808201825260008082529084015280518082018252828401518351608891821b178252606084015192909301519190921b17918101919091528252600160608601819052600060808701525b60238111610fa557610f21610f178760000151613204565b8760600151612cb5565b8482604a8110610f3357610f33615c72565b602002015260808601516101808b0151610f769190610c6d90610f57600186615ca1565b602c8110610f6757610f67615c72565b60200201518960600151612cb5565b60808701526060860151610100890151610f909190612cb5565b6060870152610f9e81615cb4565b9050610eff565b506000610fb460236001615c5f565b90505b602c811161103457610fcf610f178760200151613204565b8482604a8110610fe157610fe1615c72565b602002015260808601516101808b01516110059190610c6d90610f57600186615ca1565b6080870152606086015161010089015161101f9190612cb5565b606087015261102d81615cb4565b9050610fb7565b50606088015182600160200201526080880151826002602002015260a0880151826003602002015260c0880151826004602002015260e08801518260056020020152610100880151826006602002015261012088015182600760200201526101408801518260086020020152610180880151826009602002015261016088015182600a60200201526101a088015182600b60200201526101c088015182600c60200201526101e088015182600d602002015261020088015182600e602002015261022088015182600f60200201526102408801518260106020020152610260880151826011602002015261028088015182601260200201526102a088015182601360200201526102c088015182601460200201526102e08801518260156020020152610300880151826016602002015261032088015182601760200201526103408801518260186020020152610360880151826019602002015261038088015182601a60200201526103a088015182601b602002015260608901516111ff906040805180820190915260008082526020820152604051806040016040528060888460200151901b846000015117815260200160888460600151901b8460400151178152509050919050565b6103808301526080890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526103a083015260a0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526103c083015260c0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526103e083015260e0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610400830152610140890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610420830152610100890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610440830152610120890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526104608301526103008801516104808301526103208801516104a08301526103408801516104c08301526103608801516104e0830152606089810151604080518082018252600080825260209182015281518083018352818401518451608891821b1782529484015192909301519190931b17918101919091526105008301526080890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b9091179082015261052083015260a0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b9091179082015261054083015260c0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b9091179082015261056083015260e0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610580830152600060408601526101408701516115bb90613230565b606086015260005b6115cf6001601c615ca1565b81101561173f5760006115e460016012615ca1565b821015905060008161164e5760608801516116159085611605866002615c5f565b601d8110610e6457610e64615c72565b905061162081613204565b868461162e602c6001615c5f565b6116389190615c5f565b604a811061164857611648615c72565b60200201525b61167d8860400151610c6d838f6101c0015187600161166d9190615c5f565b601c8110610e6457610e64615c72565b604089015260608801516101408b01516116979190612cb5565b60608901526101a08c01516117089084601b81106116b7576116b7615c72565b60200201516040805180820190915260008082526020820152604051806040016040528060888460200151901b846000015117815260200160888460600151901b8460400151178152509050919050565b8584611716602c6001615c5f565b6117209190615c5f565b604a811061173057611730615c72565b602002015250506001016115c3565b5060006117578887608001518c6101c001518861323c565b604087015190915061176f90610c6d83856000610e64565b604087018190526101c08b0151516101408a015161179e9291610c6d916117969190612cb5565b856001610e64565b60408088019190915280518082019091526001815260026020820152836117c7601c602c615c5f565b604a81106117d7576117d7615c72565b60200201526040860151846117ee601c602c615c5f565b604a81106117fe576117fe615c72565b60200201526102008a015160009061185c906040805180820190915260008082526020820152604051806040016040528060888460200151901b846000015117815260200160888460600151901b8460400151178152509050919050565b9050808461186c601c602c615c5f565b611877906001615c5f565b604a811061188757611887615c72565b60200201526101608901518561189f601c602c615c5f565b6118aa906001615c5f565b604a81106118ba576118ba615c72565b602002015260006118cb8587613341565b905060006118d883613414565b90506118e4828261348c565b9d9c50505050505050505050505050565b6118fd615253565b50604080516103c0810182526204000081526012602080830191909152604382840152825180840184526000808252818301526060830152825180840184527e23296072ba882e23ed90ee1dac8eedbb30e5b4fbbf6a8be14cc97eaa44669381527f1540513d0b8971ae7c56b28838a830801b04cc4f3a3dde06c3eac3410a2ee9c4818301526080830152825180840184527f128f4689193e8d7e352ac5f0afe29ff277d1b8b08807981784a590b82a9b5e2e81527f1aa8be7d44f5bf4c12440bd390aeb102e211af54f0c176e5a7aaecdf495435748183015260a0830152825180840184527f2b0a33558c2603b6bc43635665be9da0f5e2f623bea9e22dd055c74324d7f12281527f162d39578897a70f2dc851710de29d3dd6fae4e768f2c841aa7b95834ceae5cb8183015260c0830152825180840184527f262d979b29df1669541daa3f02157701ff7ab07a6f5317d2e4d1c4c2106e17e381527f06af46ef2dc4282de259c7e02867c3c77a799af864e2370f61a8f1aec7a7f4098183015260e0830152825180840184527f0e45f7edf0975574a0234a5c0510af9251c52534b527f8af7bd17a4c6095909681527f2053c39f8961e378924eb488270ae9caab9db0bbf2d2937c0fef89a40000d21481830152610100830152825180840184527f24792fa51f5beafb9c4eff1a8bf1a9a6ccd9a02877d64ec78becc03bc9f7d1ff81527f2b3a9b5ddd9cf49b41974c5cb73e39997fd915a8df5b8458fa08d02a55a9644381830152610120830152825180840184527f1df1862c3cd967cf4e80a289e6fec969049ae11aac5a796ac650315d22e580fb81527f2afb83456939046324306525332ef3307638d6766ff90e40559aa45e471b871b81830152610140830152825180840184527f1c2f84adf95896cf0018ae79ebbdeb2468b1404953a855ec2facc4b49449543381527f0a175b5ba1452877e6cb7ac6ca850788f7e17a56f310cb5f18d9642b7bdcbcf281830152610160830152825180840184527f286ee766413caa93518a7570875801a9159d2e1315c1ab5bc9e52595a830c49581527f045175bd839a41eda5e9b6a40f76bbbf2723a68e1e7ecd739bd97ae093cd652881830152610180830152825180840184527f22ffd03e53836f0a9271398e34a792953979926b49a76c967c71cc8af35e04bb81527f02e2ae071779429f971820e5d680764ae55b0a0db4bc14709d47abc261cfe64c818301526101a0830152825180840184527f034ab86a5bccfa4f69637da232ba777f403c1aeb69ad6040d432a795e1b382c281527f09a353e2a34ad0af28688dbf4c01cc7de2c9878d6a1b80ce58e567d6c48b5bec818301526101c0830152825180840184527f1a65519a1ab82173d9cb9dc061f62c9d53ef95915b0cc76feb9feb90351e810d81527f29c0afd9c7eeae8e1635b3835090d59d5344bd56cf3c71487adcf6d8c5844348818301526101e0830152825180840184527f139c2f5bba86aea351df6608e3f1cd26b3c0b4371dca357e701a6025f94be1e781527f22399eb57ad19a4409a194335726da4d76a0cf2d0d89a50dbc7f687de1aad8c381830152610200830152825180840184527f0ff16a5ae01ecffc7815eb75c174ad14281aa49059929907518634d841c628f581527f2d867f1d311969273bc82b184e63d9269b182a881d3b302b242a4dc93462f7b781830152610220830152825180840184527f0821760c77fc15784afcaff815f73f8f90aa38ebe34d3b48695e3a6ad08ed8b081527f2f51bc8941e5c577f7ec1d5bb038bd902c7a5c7dd1389bab38b9c89ec4ab7d2981830152610240830152825180840184527f0ffd51787978d66be3b7e70e810c4575178c9f45674db1b870595ce7e2fb5f6f81527f17a63d56e53061da2fe13b311859cb536d18d6060100c393c5bb9251dfbad74a81830152610260830152825180840184527f024dcf715a66fd964f629553ae2bcb51c127b813ed7f9a4b28b481fb9e2c377281527f20244a5d7222400941070d0355a58d34ab8ff9b0d8935fd8c9225059f13fcaac81830152610280830152825180840184527f02987fe7cdb3cab8ebf18ecc8711b792828a0670bd9bcd17442c4a157325c8ef81527f1c9fa626c623b3102d77b2878a9de76dd9a1837521baa49c6874797a8e5a9626818301526102a0830152825180840184527f130b070560870337eb165683645e3c8522d6449e1367a35c5cf00dd4462fd96781527f01fe23c3926178b337c362c53b74d2233d08cf587bb0f114ebfe21542c9645e5818301526102c0830152825180840184527f153a7f8639e06461474e00018cde1ac1acf38089893c5515de20804922c0321981527f0939c3d22ab03cefb504fe214af93d65912ae3750ce6b756b0e02c9ce7a16e68818301526102e0830152825180840184527f234c57b9aab8dfb66855cbb2ed5c7dcaa724527a8b5abae05dbfc771da6679cc81527f22060d556338e2843aed696c8fc98bf0c6d133543b5c8774daf51221e0eafb4481830152610300830152825180840184527f2c931d2ddd0a37bf249ba13d4c0005dcf10f905b44f587692f7e19c4325beece81527f02d3dc1f3ed31519bae6c333e090615800a04cfdc9d6233f823114a44746d50181830152610320830152825180840184527f06246fd4811f690574ddc55745590439a8f73455e78fdd3521d65c7e007e6b4581527f1e132a30f5aa1d892595234280dd91b7728b3dadc7b72e58f2a95148f38ba21081830152610340830152825180840184527f1e0181f12b41a00b4ee891ed5a942bfdbae834b4faf95ce9e9aaa9bd2500ce6381527f1b6f032aa6b07625de54649d25628c9a5c45ab7c6c13a88fdd31ca7ecce024af81830152610360830152825180840184527f19b09aa2fcb34ae480845aa4ad56e01616ae845300e6f676fdb84f4bd396851b81527f295d8a6bfcce573b23d5eefd0aab6d32479423acd4956ce6deb5a67073f032d58183015261038083015282518084019093527f08d314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b83527f0100000000000000000000000000000000000000000000000000000000000000908301526103a081019190915290565b6000610b6c7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000183615d1b565b600080808080612216866003615c5f565b61222190600c615c5f565b67ffffffffffffffff81111561223957612239615d2f565b604051908082528060200260200182016040528015612262578160200160208202803683370190505b509050886000015160001b8160008151811061228057612280615c72565b602002602001018181525050886020015160001b816001815181106122a7576122a7615c72565b602002602001018181525050886040015160001b816002815181106122ce576122ce615c72565b60200260200101818152505060005b8681101561232f578888828181106122f7576122f7615c72565b905060200201358282600361230c9190615c5f565b8151811061231c5761231c615c72565b60209081029190910101526001016122dd565b5060608901515181612342886003615c5f565b8151811061235257612352615c72565b60209081029190910181019190915260608a0151015181612374886003615c5f565b61237f906001615c5f565b8151811061238f5761238f615c72565b6020908102919091010152606089015160400151816123af886003615c5f565b6123ba906002615c5f565b815181106123ca576123ca615c72565b60209081029190910101526060808a01510151816123e9886003615c5f565b6123f4906003615c5f565b8151811061240457612404615c72565b602090810291909101015260808901515181612421886003615c5f565b61242c906004615c5f565b8151811061243c5761243c615c72565b60209081029190910181019190915260808a015101518161245e886003615c5f565b612469906005615c5f565b8151811061247957612479615c72565b602090810291909101015260808901516040015181612499886003615c5f565b6124a4906006615c5f565b815181106124b4576124b4615c72565b6020908102919091010152608089015160600151816124d4886003615c5f565b6124df906007615c5f565b815181106124ef576124ef615c72565b602090810291909101015260a0890151518161250c886003615c5f565b612517906008615c5f565b8151811061252757612527615c72565b60209081029190910181019190915260a08a0151015181612549886003615c5f565b612554906009615c5f565b8151811061256457612564615c72565b602090810291909101015260a08901516040015181612584886003615c5f565b61258f90600a615c5f565b8151811061259f5761259f615c72565b602090810291909101015260a089015160600151816125bf886003615c5f565b6125ca90600b615c5f565b815181106125da576125da615c72565b602002602001018181525050612615816040516020016125fa9190615d5e565b604051602081830303815290604052805190602001206121d9565b9150612620826136a0565b604080516020810186905292975090955061263b91016125fa565b91506000612648836136a0565b50959a949950949750909550919350505050565b600080600061266961590d565b8581526101008581018051516020808501919091528151810151604080860191909152825181015160608087019190915292518301516080860152610120808a0180515160a0880152805184015160c080890191909152815184015160e089015290518501519587019590955293890180515194860194909452835182015161014086015283518101516101608601529251909101516101808401529051612717916125fa91849101615d94565b9150612722826136a0565b90979096509194509092505050565b61273961592c565b600061274361594b565b8481526101408401805151602080840191909152815181015160408085019190915282518101516060808601919091529251830151608085015260e080880180515160a0870152805184015160c0870152805183015191860191909152519092015161010084015290516127bd916125fa91849101615dc9565b91506127c8826136a0565b6020850152835260015b6127de60026019615dfe565b81101561285e576127fb836040516020016125fa91815260200190565b9250612806836136a0565b85612812846002615c48565b6019811061282257612822615c72565b6020020186612832856002615c48565b61283d906001615c5f565b6019811061284d5761284d615c72565b6020020191909152526001016127d2565b50612875826040516020016125fa91815260200190565b91506000612882836136a0565b8561288f60016019615ca1565b6019811061289f5761289f615c72565b60200201919091525050509250929050565b6128b961596a565b6000805b601c81101561290d576128dc846040516020016125fa91815260200190565b935060006128e9856136a0565b8584601c81106128fb576128fb615c72565b602002019190915250506001016128bd565b5090929050565b61291c61596a565b6000805b601c8110156129e25761293161594b565b84815260005b600881101561299b5786610160015183601c811061295757612957615c72565b6020020151816008811061296d5761296d615c72565b60200201518261297e836001615c5f565b6009811061298e5761298e615c72565b6020020152600101612937565b506129b0816040516020016125fa9190615dc9565b945060006129bd866136a0565b8685601c81106129cf576129cf615c72565b6020020191909152505050600101612920565b50909391925050565b6000806129f6615989565b83815260005b602c811015612a4a5785610180015181602c8110612a1c57612a1c615c72565b602002015182612a2d836001615c5f565b602d8110612a3d57612a3d615c72565b60200201526001016129fc565b50612a5f816040516020016125fa9190615e12565b91506000612a6c836136a0565b5096929550919350505050565b600080612a846159a8565b83815260005b612a966001601c615ca1565b811015612bd457856101a0015181601b8110612ab457612ab4615c72565b60200201515182612ac6836004615c48565b612ad1906001615c5f565b606d8110612ae157612ae1615c72565b60200201526101a086015181601b8110612afd57612afd615c72565b60200201516020015182826004612b149190615c48565b612b1f906002615c5f565b606d8110612b2f57612b2f615c72565b60200201526101a086015181601b8110612b4b57612b4b615c72565b60200201516040015182612b60836004615c48565b612b6b906003615c5f565b606d8110612b7b57612b7b615c72565b60200201526101a086015181601b8110612b9757612b97615c72565b60200201516060015182612bac836004615c48565b612bb7906004615c5f565b606d8110612bc757612bc7615c72565b6020020152600101612a8a565b50612a5f816040516020016125fa9190615e47565b600080612bf46159c7565b83815260005b601c811015612c4857856101c0015181601c8110612c1a57612c1a615c72565b602002015182612c2b836001615c5f565b601d8110612c3b57612c3b615c72565b6020020152600101612bfa565b50612a5f816040516020016125fa9190615e7c565b600080612c686159e6565b8381526101e085018051516020808401919091528151810151604080850191909152825181015160608086019190915292519092015160808401529051612a5f916125fa91849101615eb1565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284099392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284089392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001612d5c837f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b84089392505050565b6000612d7483610c6884613170565b9392505050565b81516000908190612d94908560015b6020020151612ce2565b929092149392505050565b6000806040518061010001604052807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffec5181526020016102d081526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff118152602001609081526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff71815260200160f081526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593effffd3181526020016113b081525090506000604051806101000160405280600081526020016001815260200160028152602001600381526020016004815260200160058152602001600681526020016007815250905060006001905060005b6008811015612ed457612eca82610c688884612d0f565b9150600101612eb3565b50612edd615a04565b60005b6008811015612f56576000858260088110612efd57612efd615c72565b60200201519050612f2881610c688a888660088110612f1e57612f1e615c72565b6020020151612d0f565b9050612f3381613170565b905080838360088110612f4857612f48615c72565b602002015250600101612ee0565b5060005b6008811015612fab576000888260088110612f7757612f77615c72565b60200201519050612f9481848460088110610e6457610e64615c72565b9050612fa08782612ce2565b965050600101612f5a565b50612fb68583612cb5565b979650505050505050565b600080612ff26001610c6d86610c688a60c0015188601c8110612fe657612fe6615c72565b60200201516001612d0f565b9050610de18582612cb5565b61018083015160009061300f615a23565b61301a8282866136da565b6130268286838761388b565b61303282868387613a79565b61303d828286613c80565b613048828286613e72565b613054828683876141d1565b61305f828286614ade565b61306a828286614eba565b610de1818660a001516151bc565b61308061596a565b81815260015b601c8110156130d7576130b88261309e600184615ca1565b601c81106130ae576130ae615c72565b6020020151613230565b8282601c81106130ca576130ca615c72565b6020020152600101613086565b50919050565b6130e56159c7565b6101608301516130ff6130fa82856000612f1e565b613170565b825260005b601c81101561316857600061311b60126001615c5f565b821161313d5761313a6130fa848785601c8110612d8a57612d8a615c72565b90505b808461314a846001615c5f565b601d811061315a5761315a615c72565b602002015250600101613104565b505092915050565b6000808290506000604051602081526020808201526020604082015282606082015260027f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000010360808201527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000160a08201526020600060c08360055afa9050806131f857600080fd5b50506000519392505050565b6000610b6c827f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b6000610b6c8283612cb5565b6000601c5b801561333757600083613255600184615ca1565b601c811061326557613265615c72565b6020020151905060008760e001516001846132809190615ca1565b601c811061329057613290615c72565b602002015190506000866132a5600186615ca1565b601c81106132b5576132b5615c72565b6020020151905060006132f16132d56132ce868c612cb5565b6002612cb5565b610c8c84610c686132eb89610c6860018b612d0f565b88612d0f565b905061331281610c686130fa61330c88610c6860018a612d0f565b87612ce2565b90506012851180613321578199505b50505050508061333090615ee5565b9050613241565b5092949350505050565b60408051808201909152600080825260208201526000613363601c602c615c5f565b61336e906002615c5f565b90506001604051855151604082015285516020015160608201528451608082015260408160606040840160075afa8216915060015b838110156133fc5760208102870160208202870181515160408501528151602001516060850152805160808501525050604080830160606040850160075afa8316925060408260808460065afa909216916001016133a3565b50805184526020810151602085015250505092915050565b60408051808201909152600080825260208201527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4782602001517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476134799190615ca1565b6134839190615d1b565b60208301525090565b81516020808401518351848301516040805194850195909552938301919091527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260608301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60808301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60a08301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60c083015260e08201526101008101919091527f260e01b251f6f1c7e7ff4e580791dee8ea51d87a358e038b4efe30fac09383c16101208201527f0118c4d5b837bcc2bc89b5b398b5974e9f5944073b32078b7e231fec938883b06101408201527f04fc6369f7110fe3d25156c1bb9a72859cf2a04641f99ba4ee413c80da6a5fe46101608201527f22febda3c0c0632a56475b4214e5615e11e6dd3f96e6cea2854a87d4dacc5e5561018082015260009081906101a0016040516020818303038152906040529050600080600873ffffffffffffffffffffffffffffffffffffffff16836040516136319190615f1a565b600060405180830381855afa9150503d806000811461366c576040519150601f19603f3d011682016040523d82523d6000602084013e613671565b606091505b509150915060008180602001905181019061368c9190615f49565b9050828015612fb657509695505050505050565b600080826fffffffffffffffffffffffffffffffff8116608082901c6136c5826121d9565b94506136d0816121d9565b9350505050915091565b60006136e7846006615222565b90507f183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f8000000600061374a61374461371d856003612d0f565b610c6861373961372e8b6000615222565b610c688c601c615222565b610c688b601b615222565b83612cb5565b90506137cb6137c06137a761378e61377585610c6d61376a8d6002615222565b610c688e601b615222565b610c6d6137838c6003615222565b610c688d601c615222565b610c6d61379c8b6004615222565b610c688c601d615222565b610c6d6137b58a6005615222565b610c688b601e615222565b610c6d886001615222565b90506137ea81610c6d6137df866001612d0f565b610c688a602a615222565b90506137f68184612cb5565b90506138028185612cb5565b8552506000905061383e61383361382861381d88601b615222565b610c6d89601e615222565b610c8c886027615222565b610c6d876000615222565b905061384f81610c68846002612d0f565b905061386081610c68846001612d0f565b905061386c8183612cb5565b90506138788184612cb5565b9050808460015b60200201525050505050565b60008060006138c36138b96138a189601b615222565b610c6d6138af8b6011615222565b8a60600151612cb5565b8760800151612ce2565b90506138fc81610c686138f26138da8b601c615222565b610c6d6138e88d6012615222565b8c60600151612cb5565b8960800151612ce2565b905061392181610c686138f26139138b601d615222565b610c6d6138e88d6013615222565b905061394681610c686138f26139388b601e615222565b610c6d6138e88d6014615222565b92506000905061396b6138b961395d89601b615222565b610c6d6138af8b600d615222565b905061399081610c686138f26139828b601c615222565b610c6d6138e88d600e615222565b90506139b581610c686138f26139a78b601d615222565b610c6d6138e88d600f615222565b90506139da81610c686138f26139cc8b601e615222565b610c6d6138e88d6010615222565b915060009050613a026139fc6139f189601f615222565b610c6d8a6019615222565b84612cb5565b9050613a3881610c8c613a32613a198b602b615222565b610c6d613a278d601a615222565b8c6101800151612cb5565b85612cb5565b9050613a448185612cb5565b6040860152506000613a68613a32613a5d89601a615222565b610c688a602b615222565b606090950194909452505050505050565b600080613ad8613ac0613aa8613a936138f28a6015615222565b610c6d613aa18b6016615222565b8a51612cb5565b610c6d613ab68a6017615222565b8960200151612cb5565b610c6d613ace896018615222565b8860400151612cb5565b91506000613b10613af7613aed89601b615222565b8860800151612ce2565b610c6d613b058a6003615222565b610c688b6027615222565b90506000613b3b613b2289601c615222565b610c6d613b308b6000615222565b610c688c6028615222565b90506000613b66613b4d8a601d615222565b610c6d613b5b8c6001615222565b610c688d6029615222565b9050613ba6613b8e613b8085610c6d868d60000151612cb5565b610c6d848c60200151612cb5565b610c6d613b9c8c6004615222565b8b60400151612cb5565b93505050506000613bbb6139fc886020615222565b90506000613bcd6139fc896020615222565b90506000613c06613bed613be28b6022615222565b610c6d8c600a615222565b610c8c613bfb8c6022615222565b610c688d600a615222565b90506000613c2b613c25613c1a8789612cb5565b610c688d6020615222565b83612d0f565b9050613c378188612cb5565b90506000613c60613c52613c4c8d600a615222565b87612cb5565b610c8c613c4c8e6021615222565b60808a018390529050808960055b60200201525050505050505050505050565b6000613c8e60006001612d0f565b90506000613c9e60006002612d0f565b90506000613cae60006003612d0f565b90506000613ccb613cc088601c615222565b610c8c89601b615222565b90506000613ce8613cdd89601d615222565b610c8c8a601c615222565b90506000613d05613cfa8a601e615222565b610c8c8b601d615222565b90506000613d22613d178b6027615222565b610c8c8c601e615222565b905083613d3381610c68818b612ce2565b9050613d4381610c68878a612ce2565b9050613d5381610c688789612ce2565b9050613d6481610c688d6007615222565b9050613d70818a612cb5565b60c08b01525082613d8581610c68818b612ce2565b9050613d9581610c68868a612ce2565b9050613da581610c688689612ce2565b9050613db681610c688d6007615222565b9050613dc2818a612cb5565b60e08b01525081613dd781610c68818b612ce2565b9050613de781610c68858a612ce2565b9050613df781610c688589612ce2565b9050613e0881610c688d6007615222565b9050613e14818a612cb5565b6101008b01525080613e2a81610c68818b612ce2565b9050613e3a81610c68848a612ce2565b9050613e4a81610c688489612ce2565b9050613e5b81610c688d6007615222565b9050613e67818a612cb5565b9050808a6009613c6e565b613eb26040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b613ebd84601c615222565b8152613eca84601d615222565b6020820152613eda846027615222565b6040820152613eea84602a615222565b6060820152613efa846029615222565b6080820152613f0a846028615222565b60a08201526000613f1c856002615222565b90506000613f2b866000615222565b90506000613f4184604001518560000151612d0f565b90506000613f5785602001518660200151612cb5565b60608601519091508690600090613f6e9080612cb5565b90506000613f8d613f8789602001518a60600151612cb5565b88612cb5565b90506000613fad613fa68a60a001518b60400151612ce2565b8a51612ce2565b9050613fbc613c4c8288612cb5565b9050613fdd613fd7613fd16132eb8487612d0f565b84612ce2565b83612ce2565b9050614005613ffa613fef8387612cb5565b610c688f6008615222565b610c6860018a612d0f565b6101408c0152505050506020850151608086015160009161402591612ce2565b9050600061404461403a886060015188612cb5565b8860200151612d0f565b9050600061406a6140558487612cb5565b610c6d613a328b60a001518c60000151612d0f565b905061409261408761407c838c612cb5565b610c688e6008615222565b610c68600189612d0f565b6101608b015250600091506140b490506140ad836011612ce2565b8751612cb5565b905060006140c28384612ce2565b90506140ce8182612ce2565b905060006140dd836009612cb5565b90506141076141016139fc6140fa8b60a001518c60000151612ce2565b8b51612ce2565b82612d0f565b60c0890181905260009061412390613f8790613fef908d612cb5565b90506141368b600a602002015182612ce2565b6101408c0152505086516000925061415e91506140ad906141579080612ce2565b8851612ce2565b905060006141a061417b83610c688a600001518b60a00151612d0f565b6020890151610c8c9061418e9080612ce2565b610c688b602001518c60800151612ce2565b90506141bd89600b6020020151610c6d613f87613fef858d612cb5565b89600b602002015250505050505050505050565b61427b604051806102c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6142b061429761428c87601b615222565b610c68886028615222565b610c6d6142a5886027615222565b610c6889601c615222565b81526142f56142ea6142d16142c688601b615222565b610c6889601e615222565b610c6d6142df89601c615222565b610c688a601d615222565b610c8c876029615222565b6040820181905261430f9068100000000000000000612cb5565b6040820181905261432590610c8c87602a615222565b6040820181905281516143389190612ce2565b6040820181905261434e90610c68876005615222565b604082015280516143689068100000000000000000612cb5565b80825261438890610c6d61437d886027615222565b610c68896028615222565b808252602082018190526143a490610c8c61381d88601d615222565b602082018190526143ba90610c68876004615222565b60208201528051606082018190526143d790610c6d87601e615222565b606082018190526143fb90610c8c6143f0886029615222565b610c6d89602a615222565b6060820181905261441190610c68876000615222565b816060018181525050600061443b61443183602001518460400151612ce2565b8360600151612ce2565b905061444c81610c68886003615222565b905061446461445c876028615222565b614000612cb5565b6080830181905261447a90610c6d886027615222565b6080830181905261448d90614000612cb5565b608083018190526144a390610c6d88601d615222565b608083018190526144b690614000612cb5565b608083018190526144cc90610c6d88601c615222565b608083018190526144df90614000612cb5565b608083018190526144f590610c6d88601b615222565b6080830181905261450b90610c8c88601e615222565b6080830181905261452190610c68886005615222565b608083015261453461445c876029615222565b60a0830181905261454a90610c6d886028615222565b60a0830181905261455d90614000612cb5565b60a0830181905261457390610c6d886027615222565b60a0830181905261458690614000612cb5565b60a0830181905261459c90610c6d88601e615222565b60a083018190526145af90614000612cb5565b60a083018190526145c590610c6d88601d615222565b60a083018190526145db90610c8c88602a615222565b60a083018190526145f190610c68886000615222565b60a08301819052608083015160009161460a9190612ce2565b905061461b81610c68896004615222565b905061463561462b88601d615222565b8760400151612cb5565b60c0840181905261464e90610c6d613ab68a601c615222565b60c0840181905261466e90610c6d6146678a601b615222565b8951612cb5565b60c0840181905261468490610c6d896001615222565b60c0840181905260e084018190526146a190610c8c89601e615222565b60c08401526146b4613cc0886027615222565b6101408401526146d36146c888602a615222565b610c8c89601e615222565b6101208401526101408301516146f8906146ed9080612cb5565b846101400151612d0f565b61028084015261014083015161474d906147429061473b90610c6860017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b6001612ce2565b846101200151612cb5565b61016084018190526147849061477690610c6861476b8b6002615222565b610c688c6003615222565b610c68613c4c8a6009615222565b6101a08601526102808301516147a69061477690610c6861476b8b6002615222565b6101c086015260c08301516147ce90610c686147c38a6002615222565b610c688b6003615222565b6101e084015260006147ee6147e489601e615222565b8560e00151612d0f565b90506147fd6141018283612cb5565b6101a0850152614811613ace896029615222565b610100850181905261483590610c6d61482b8b6028615222565b8a60200151612cb5565b610100850181905261484f90610c6d613aa18b6027615222565b61010085015261486e61486389602a615222565b856101000151612d0f565b6101008501526000614884613cfa8a6029615222565b90506148fe6148c561374461473b88610140015160017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001610c689190615ca1565b610c6861473b88610100015160017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001610c689190615ca1565b610180860152610100850151614923906149189080612cb5565b866101000151612d0f565b6101c08601526101808501516149569061494290610c688c6006615222565b610c686149508c6009615222565b89612cb5565b6101e08801526102808501516149759061494290610c688c6006615222565b6102008801526101c08501516149949061494290610c688c6006615222565b6102208801526101a08501516149af90610c688b6006615222565b6102008601526149ce6149c38a6028615222565b610c8c8b601c615222565b610220860152610140850151614a2090613cfa90614a159061473b90610c6860017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b876102200151612cb5565b61024086018190526101e08601516102608701819052614a5791610c6d90610c68614a4c8e6005615222565b610c688f6002615222565b610260860181905260c0860151614a7b9190610c6d90610c68614a4c8e6000615222565b6102608601819052610200860151614a939190612ce2565b6102608601819052614aa990613fd19086612ce2565b6102a08601819052614ac390610c686149508c6009615222565b6102a0860181905287600c6020020152505050505050505050565b614b6560405180610220016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b614b7e614b7385601b615222565b610c6d866002615222565b8152614b99614b8e85601c615222565b610c6d866003615222565b6020820152614bb7614bac85601d615222565b610c6d866004615222565b6040820152614bd5614bca85601e615222565b610c6d866005615222565b60608201528051614c0790614c0090614bf990614bf29080612cb5565b8451612cb5565b8351612cb5565b8251612cb5565b60808201526020810151614c4590614c3b90614c3190614c279080612cb5565b8460200151612cb5565b8360200151612cb5565b8260200151612cb5565b60a08201526040810151614c8390614c7990614c6f90614c659080612cb5565b8460400151612cb5565b8360400151612cb5565b8260400151612cb5565b60c08201526060810151614cc190614cb790614cad90614ca39080612cb5565b8460600151612cb5565b8360600151612cb5565b8260600151612cb5565b60e0820152608081015160a0820151614cda9190612ce2565b61010082015260c081015160e0820151614cf49190612ce2565b61012082015260a0810151614d1890614d0d9080612ce2565b826101200151612ce2565b61014082015260e0810151614d3c90614d319080612ce2565b826101000151612ce2565b610160820152610120810151614d529080612ce2565b6101e08201819052614d7390614d689080612ce2565b826101600151612ce2565b6101e0820152610100810151614d899080612ce2565b6101a08201819052614daa90614d9f9080612ce2565b826101400151612ce2565b6101a08201819052610160820151614dc191612ce2565b6101808201526101408101516101e0820151614ddd9190612ce2565b6101c0820152614df161374485600b615222565b6102008201819052610240840151610180830151614e1c92610c6d91610c6890610c8c8a6027615222565b8360126020020152614e4c8360136020020151610c6d836102000151610c68856101a00151610c8c8a6028615222565b8360136020020152614e7c8360146020020151610c6d836102000151610c68856101c00151610c8c8a6029615222565b8360146020020152614eac8360156020020151610c6d836102000151610c68856101e00151610c8c8a602a615222565b836015602002015250505050565b614f1760405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006040518060800160405280614f4d7f10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e76121d9565b8152602001614f7b7f0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b6121d9565b8152602001614fa87e544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac156121d9565b8152602001614fd67f222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b6121d9565b90529050614ff3614fe886601b615222565b610c6d876002615222565b61012083018190526150279061501c90614742906150119080612cb5565b856101200151612cb5565b836101200151612cb5565b825261503485601c615222565b602083015261504485601d615222565b604083015261505485601e615222565b60608301528151602083015161507c91614431916150729190612ce2565b8460400151612ce2565b608083015261508f6139fc86600c615222565b61014083015281516150b1906150a790836000610e64565b8360800151612ce2565b60a08301526150dd8460166020020151610c6d846101400151610c688660a00151610c8c8b6027615222565b6102c085015260208201516150f8906150a790836001610e64565b60c08301526151248460176020020151610c6d846101400151610c688660c00151610c8c8b6028615222565b6102e0850152604082015161513f906150a790836002610e64565b60e083015261516b8460186020020151610c6d846101400151610c688660e00151610c8c8b6029615222565b6103008501526060820151615186906150a790836003610e64565b6101008301526151b48460196020020151610c6d846101400151610c68866101000151610c8c8b602a615222565b84601961387f565b60006151c9818481612d8a565b905060015b601a81101561521b5761521182610c6d8684601a81106151f0576151f0615c72565b602002015186615201600187615ca1565b60198110610e6457610e64615c72565b91506001016151ce565b5092915050565b60008282602b81111561523757615237615f6b565b602c811061524757615247615c72565b60200201519392505050565b604051806103c00160405280600081526020016000815260200160008152602001615291604051806040016040528060008152602001600081525090565b81526020016152b3604051806040016040528060008152602001600081525090565b81526020016152d5604051806040016040528060008152602001600081525090565b81526020016152f7604051806040016040528060008152602001600081525090565b8152602001615319604051806040016040528060008152602001600081525090565b815260200161533b604051806040016040528060008152602001600081525090565b815260200161535d604051806040016040528060008152602001600081525090565b815260200161537f604051806040016040528060008152602001600081525090565b81526020016153a1604051806040016040528060008152602001600081525090565b81526020016153c3604051806040016040528060008152602001600081525090565b81526020016153e5604051806040016040528060008152602001600081525090565b8152602001615407604051806040016040528060008152602001600081525090565b8152602001615429604051806040016040528060008152602001600081525090565b815260200161544b604051806040016040528060008152602001600081525090565b815260200161546d604051806040016040528060008152602001600081525090565b815260200161548f604051806040016040528060008152602001600081525090565b81526020016154b1604051806040016040528060008152602001600081525090565b81526020016154d3604051806040016040528060008152602001600081525090565b81526020016154f5604051806040016040528060008152602001600081525090565b8152602001615517604051806040016040528060008152602001600081525090565b8152602001615539604051806040016040528060008152602001600081525090565b815260200161555b604051806040016040528060008152602001600081525090565b815260200161557d604051806040016040528060008152602001600081525090565b815260200161559f604051806040016040528060008152602001600081525090565b81526020016155c1604051806040016040528060008152602001600081525090565b81526020016155e3604051806040016040528060008152602001600081525090565b8152602001615605604051806040016040528060008152602001600081525090565b905290565b6040518061022001604052806000815260200160008152602001600081526020016156566040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156866040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156b66040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156e66040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157166040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157466040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157766040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157a66040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157b3615a42565b81526020016157c0615a70565b81526020016157cd615a8f565b81526020016157da61596a565b815260200161580a6040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156056040518060800160405280600081526020016000815260200160008152602001600081525090565b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200161587161592c565b815260200161587e61596a565b815260200161588b61596a565b815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806109400160405280604a906020820280368337509192915050565b604051806109400160405280604a905b60408051808201909152600080825260208201528152602001906001900390816158e35790505090565b604051806101a00160405280600d906020820280368337509192915050565b6040518061032001604052806019906020820280368337509192915050565b6040518061012001604052806009906020820280368337509192915050565b604051806103800160405280601c906020820280368337509192915050565b604051806105a00160405280602d906020820280368337509192915050565b60405180610da00160405280606d906020820280368337509192915050565b604051806103a00160405280601d906020820280368337509192915050565b6040518060a001604052806005906020820280368337509192915050565b6040518061010001604052806008906020820280368337509192915050565b604051806103400160405280601a906020820280368337509192915050565b604051806103800160405280601c905b615a5a615a04565b815260200190600190039081615a525790505090565b604051806105800160405280602c906020820280368337509192915050565b604051806103600160405280601b905b615aca6040518060800160405280600081526020016000815260200160008152602001600081525090565b815260200190600190039081615a9f5790505090565b60008060008060408587031215615af657600080fd5b843567ffffffffffffffff811115615b0d57600080fd5b8501601f81018713615b1e57600080fd5b803567ffffffffffffffff811115615b3557600080fd5b876020828401011115615b4757600080fd5b60209182019550935085013567ffffffffffffffff811115615b6857600080fd5b8501601f81018713615b7957600080fd5b803567ffffffffffffffff811115615b9057600080fd5b8760208260051b8401011115615ba557600080fd5b949793965060200194505050565b60008085851115615bc357600080fd5b83861115615bd057600080fd5b5050820193919092039150565b80356020831015610b6c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610b6c57610b6c615c19565b80820180821115610b6c57610b6c615c19565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610b6c57610b6c615c19565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615ce557615ce5615c19565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082615d2a57615d2a615cec565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8151600090829060208501835b82811015615d89578151845260209384019390910190600101615d6b565b509195945050505050565b60008183825b600d811015615db9578151835260209283019290910190600101615d9a565b5050506101a08201905092915050565b60008183825b6009811015615dee578151835260209283019290910190600101615dcf565b5050506101208201905092915050565b600082615e0d57615e0d615cec565b500490565b60008183825b602d811015615e37578151835260209283019290910190600101615e18565b5050506105a08201905092915050565b60008183825b606d811015615e6c578151835260209283019290910190600101615e4d565b505050610da08201905092915050565b60008183825b601d811015615ea1578151835260209283019290910190600101615e82565b5050506103a08201905092915050565b60008183825b6005811015615ed6578151835260209283019290910190600101615eb7565b50505060a08201905092915050565b600081615ef457615ef4615c19565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6000825160005b81811015615f3b5760208186018101518583015201615f21565b506000920191825250919050565b600060208284031215615f5b57600080fd5b81518015158114612d7457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220713aa0ceca32cc201db9cc83c7b665d6bec0c53ae3338734af7de9935d933c1964736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ea50d0e414610030575b600080fd5b61004361003e366004615ae0565b610057565b604051901515815260200160405180910390f35b6000806100626101b9565b9050600061007087876101ce565b604083015190915084146100b0576040517ffa06659300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006100c28287878660400151610b72565b90506101108686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050506060830151608084015186516040870151610c4d565b61018082015260006101228383610d11565b90508061015b576040517f9fc3a21800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610168848685610deb565b9050806101a1576040517fa5d82e8a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8180156101ab5750805b9a9950505050505050505050565b6101c1615253565b6101c96118f5565b905090565b6101d661560a565b6101de61560a565b6101ec602060008587615bb3565b6101f591615bdd565b8152610205604060208587615bb3565b61020e91615bdd565b6020820152610221606060408587615bb3565b61022a91615bdd565b6040808301919091528051608080820190925290819061024d9060608789615bb3565b61025691615bdd565b815260200161026960a060808789615bb3565b61027291615bdd565b815260200161028560c060a08789615bb3565b61028e91615bdd565b81526020016102a160e060c08789615bb3565b6102aa91615bdd565b905260608201526040805160808101909152806102cc61010060e08789615bb3565b6102d591615bdd565b81526020016102ea6101206101008789615bb3565b6102f391615bdd565b81526020016103086101406101208789615bb3565b61031191615bdd565b81526020016103266101606101408789615bb3565b61032f91615bdd565b9052608080830191909152604080519182019052806103546101806101608789615bb3565b61035d91615bdd565b81526020016103726101a06101808789615bb3565b61037b91615bdd565b81526020016103906101c06101a08789615bb3565b61039991615bdd565b81526020016103ae6101e06101c08789615bb3565b6103b791615bdd565b905260a08201526040805160808101909152806103da6102006101e08789615bb3565b6103e391615bdd565b81526020016103f86102206102008789615bb3565b61040191615bdd565b81526020016104166102406102208789615bb3565b61041f91615bdd565b81526020016104346102606102408789615bb3565b61043d91615bdd565b90526101008201526040805160808101909152806104616102806102608789615bb3565b61046a91615bdd565b815260200161047f6102a06102808789615bb3565b61048891615bdd565b815260200161049d6102c06102a08789615bb3565b6104a691615bdd565b81526020016104bb6102e06102c08789615bb3565b6104c491615bdd565b90526101208201526040805160808101909152806104e86103006102e08789615bb3565b6104f191615bdd565b81526020016105066103206103008789615bb3565b61050f91615bdd565b81526020016105246103406103208789615bb3565b61052d91615bdd565b81526020016105426103606103408789615bb3565b61054b91615bdd565b905260c082015260408051608081019091528061056e6103806103608789615bb3565b61057791615bdd565b815260200161058c6103a06103808789615bb3565b61059591615bdd565b81526020016105aa6103c06103a08789615bb3565b6105b391615bdd565b81526020016105c86103e06103c08789615bb3565b6105d191615bdd565b90526101408201526040805160808101909152806105f56104006103e08789615bb3565b6105fe91615bdd565b81526020016106136104206104008789615bb3565b61061c91615bdd565b81526020016106316104406104208789615bb3565b61063a91615bdd565b815260200161064f6104606104408789615bb3565b61065891615bdd565b905260e082015261046060005b601c81101561072a576000600861067d836020615c48565b6106879190615c48565b6106919084615c5f565b905060005b60088110156107205760006106ac826020615c48565b6106b69084615c5f565b905060006106c5826020615c5f565b90506106e46106d682848c8e615bb3565b6106df91615bdd565b6121d9565b87610160015186601c81106106fb576106fb615c72565b6020020151846008811061071157610711615c72565b60200201525050600101610696565b5050600101610665565b506107376008601c615c48565b610742906020615c48565b61074c9082615c5f565b905060005b602c8110156107b7576000610767826020615c48565b6107719084615c5f565b90506000610780826020615c5f565b90506107916106d682848a8c615bb3565b85610180015184602c81106107a8576107a8615c72565b60200201525050600101610751565b506107c4602c6020615c48565b6107ce9082615c5f565b905060005b6107df6001601c615ca1565b8110156108ff5760006107f3826080615c48565b6107fd9084615c5f565b9050600061080c826020615c5f565b905080600061081c826020615c5f565b905080600061082c826020615c5f565b905080600061083c826020615c5f565b905060405180608001604052808f8f8b908b9261085b93929190615bb3565b61086491615bdd565b60001c81526020018f8f8990899261087e93929190615bb3565b61088791615bdd565b60001c81526020018f8f879087926108a193929190615bb3565b6108aa91615bdd565b60001c81526020018f8f859085926108c493929190615bb3565b6108cd91615bdd565b90526101a08c01518a601b81106108e6576108e6615c72565b60200201525050600190960195506107d3945050505050565b5061090c6001601c615ca1565b610917906080615c48565b6109219082615c5f565b905060005b601c81101561098c57600061093c826020615c48565b6109469084615c5f565b90506000610955826020615c5f565b90506109666106d682848a8c615bb3565b856101c0015184601c811061097d5761097d615c72565b60200201525050600101610926565b50610999601c6020615c48565b6109a39082615c5f565b90506040518060800160405280868684908560206109c19190615c5f565b926109ce93929190615bb3565b6109d791615bdd565b60001c815260200186868460206109ee9190615c5f565b906109fa866040615c5f565b92610a0793929190615bb3565b610a1091615bdd565b81526020018686610a22856040615c5f565b90610a2e866060615c5f565b92610a3b93929190615bb3565b610a4491615bdd565b81526020018686610a56856060615c5f565b90610a62866080615c5f565b92610a6f93929190615bb3565b610a7891615bdd565b90526101e0830152610a8b816080615c5f565b9050604051806080016040528086868490856020610aa99190615c5f565b92610ab693929190615bb3565b610abf91615bdd565b60001c81526020018686846020610ad69190615c5f565b90610ae2866040615c5f565b92610aef93929190615bb3565b610af891615bdd565b81526020018686610b0a856040615c5f565b90610b16866060615c5f565b92610b2393929190615bb3565b610b2c91615bdd565b81526020018686610b3e856060615c5f565b90610b4a866080615c5f565b92610b5793929190615bb3565b610b6091615bdd565b90526102008301525090505b92915050565b610b7a61583a565b6000610b8886868686612205565b604086019190915260208501919091529083529050610ba7818761265c565b608085019190915260608401919091529050610bc38187612731565b60a08401919091529050610bd6816128b1565b60c08401919091529050610bea8682612914565b60e08401919091529050610bfe86826129eb565b6101008401919091529050610c138682612a79565b6101208401919091529050610c288682612be9565b6101408401919091529050610c3d8682612c5d565b5061016083015250949350505050565b600060018082610c7287610c6d8a610c686106df8a8c615c5f565b612cb5565b612ce2565b90506000610c9188610c8c8b610c686106df8b6001615c5f565b612d0f565b905060005b6043811015610d06576000610cc38c8381518110610cb657610cb6615c72565b60200260200101516121d9565b9050610cd386610c688684612ce2565b9550610ce385610c688584612ce2565b9450610cef848c612ce2565b9350610cfb838c612d0f565b925050600101610c96565b506101ab8484612d65565b6000806001815b6012811015610dcd57600086610160015182601c8110610d3a57610d3a615c72565b602002015190506000610d4d8286612d7b565b905080610d86576040517f9fc3a21800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008760e0015184601c8110610d9e57610d9e615c72565b60200201519050610daf8382612d9f565b9550610dbd88868387612fc1565b9450505050806001019050610d18565b506000610ddb868684612ffe565b90508281145b9695505050505050565b6000610e1f6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b6000610e2f846101200151613078565b9050610e396158b4565b610e416158d3565b6000610e4d87856130dd565b8051610140890151919250610e6e91610c6d908460015b6020020151612cb5565b8552610120870151610e9c90610e8390613170565b82516101408a0151610c689190610c8c90866001610e64565b602086810191909152600184526101e08a015160408051808201825260008082529084015280518082018252828401518351608891821b178252606084015192909301519190921b17918101919091528252600160608601819052600060808701525b60238111610fa557610f21610f178760000151613204565b8760600151612cb5565b8482604a8110610f3357610f33615c72565b602002015260808601516101808b0151610f769190610c6d90610f57600186615ca1565b602c8110610f6757610f67615c72565b60200201518960600151612cb5565b60808701526060860151610100890151610f909190612cb5565b6060870152610f9e81615cb4565b9050610eff565b506000610fb460236001615c5f565b90505b602c811161103457610fcf610f178760200151613204565b8482604a8110610fe157610fe1615c72565b602002015260808601516101808b01516110059190610c6d90610f57600186615ca1565b6080870152606086015161010089015161101f9190612cb5565b606087015261102d81615cb4565b9050610fb7565b50606088015182600160200201526080880151826002602002015260a0880151826003602002015260c0880151826004602002015260e08801518260056020020152610100880151826006602002015261012088015182600760200201526101408801518260086020020152610180880151826009602002015261016088015182600a60200201526101a088015182600b60200201526101c088015182600c60200201526101e088015182600d602002015261020088015182600e602002015261022088015182600f60200201526102408801518260106020020152610260880151826011602002015261028088015182601260200201526102a088015182601360200201526102c088015182601460200201526102e08801518260156020020152610300880151826016602002015261032088015182601760200201526103408801518260186020020152610360880151826019602002015261038088015182601a60200201526103a088015182601b602002015260608901516111ff906040805180820190915260008082526020820152604051806040016040528060888460200151901b846000015117815260200160888460600151901b8460400151178152509050919050565b6103808301526080890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526103a083015260a0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526103c083015260c0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526103e083015260e0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610400830152610140890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610420830152610100890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610440830152610120890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b909117908201526104608301526103008801516104808301526103208801516104a08301526103408801516104c08301526103608801516104e0830152606089810151604080518082018252600080825260209182015281518083018352818401518451608891821b1782529484015192909301519190931b17918101919091526105008301526080890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b9091179082015261052083015260a0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b9091179082015261054083015260c0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b9091179082015261056083015260e0890151604080518082018252600080825260209182015281518083018352818401518451608891821b178252606085015193909401519290931b90911790820152610580830152600060408601526101408701516115bb90613230565b606086015260005b6115cf6001601c615ca1565b81101561173f5760006115e460016012615ca1565b821015905060008161164e5760608801516116159085611605866002615c5f565b601d8110610e6457610e64615c72565b905061162081613204565b868461162e602c6001615c5f565b6116389190615c5f565b604a811061164857611648615c72565b60200201525b61167d8860400151610c6d838f6101c0015187600161166d9190615c5f565b601c8110610e6457610e64615c72565b604089015260608801516101408b01516116979190612cb5565b60608901526101a08c01516117089084601b81106116b7576116b7615c72565b60200201516040805180820190915260008082526020820152604051806040016040528060888460200151901b846000015117815260200160888460600151901b8460400151178152509050919050565b8584611716602c6001615c5f565b6117209190615c5f565b604a811061173057611730615c72565b602002015250506001016115c3565b5060006117578887608001518c6101c001518861323c565b604087015190915061176f90610c6d83856000610e64565b604087018190526101c08b0151516101408a015161179e9291610c6d916117969190612cb5565b856001610e64565b60408088019190915280518082019091526001815260026020820152836117c7601c602c615c5f565b604a81106117d7576117d7615c72565b60200201526040860151846117ee601c602c615c5f565b604a81106117fe576117fe615c72565b60200201526102008a015160009061185c906040805180820190915260008082526020820152604051806040016040528060888460200151901b846000015117815260200160888460600151901b8460400151178152509050919050565b9050808461186c601c602c615c5f565b611877906001615c5f565b604a811061188757611887615c72565b60200201526101608901518561189f601c602c615c5f565b6118aa906001615c5f565b604a81106118ba576118ba615c72565b602002015260006118cb8587613341565b905060006118d883613414565b90506118e4828261348c565b9d9c50505050505050505050505050565b6118fd615253565b50604080516103c0810182526204000081526012602080830191909152604382840152825180840184526000808252818301526060830152825180840184527e23296072ba882e23ed90ee1dac8eedbb30e5b4fbbf6a8be14cc97eaa44669381527f1540513d0b8971ae7c56b28838a830801b04cc4f3a3dde06c3eac3410a2ee9c4818301526080830152825180840184527f128f4689193e8d7e352ac5f0afe29ff277d1b8b08807981784a590b82a9b5e2e81527f1aa8be7d44f5bf4c12440bd390aeb102e211af54f0c176e5a7aaecdf495435748183015260a0830152825180840184527f2b0a33558c2603b6bc43635665be9da0f5e2f623bea9e22dd055c74324d7f12281527f162d39578897a70f2dc851710de29d3dd6fae4e768f2c841aa7b95834ceae5cb8183015260c0830152825180840184527f262d979b29df1669541daa3f02157701ff7ab07a6f5317d2e4d1c4c2106e17e381527f06af46ef2dc4282de259c7e02867c3c77a799af864e2370f61a8f1aec7a7f4098183015260e0830152825180840184527f0e45f7edf0975574a0234a5c0510af9251c52534b527f8af7bd17a4c6095909681527f2053c39f8961e378924eb488270ae9caab9db0bbf2d2937c0fef89a40000d21481830152610100830152825180840184527f24792fa51f5beafb9c4eff1a8bf1a9a6ccd9a02877d64ec78becc03bc9f7d1ff81527f2b3a9b5ddd9cf49b41974c5cb73e39997fd915a8df5b8458fa08d02a55a9644381830152610120830152825180840184527f1df1862c3cd967cf4e80a289e6fec969049ae11aac5a796ac650315d22e580fb81527f2afb83456939046324306525332ef3307638d6766ff90e40559aa45e471b871b81830152610140830152825180840184527f1c2f84adf95896cf0018ae79ebbdeb2468b1404953a855ec2facc4b49449543381527f0a175b5ba1452877e6cb7ac6ca850788f7e17a56f310cb5f18d9642b7bdcbcf281830152610160830152825180840184527f286ee766413caa93518a7570875801a9159d2e1315c1ab5bc9e52595a830c49581527f045175bd839a41eda5e9b6a40f76bbbf2723a68e1e7ecd739bd97ae093cd652881830152610180830152825180840184527f22ffd03e53836f0a9271398e34a792953979926b49a76c967c71cc8af35e04bb81527f02e2ae071779429f971820e5d680764ae55b0a0db4bc14709d47abc261cfe64c818301526101a0830152825180840184527f034ab86a5bccfa4f69637da232ba777f403c1aeb69ad6040d432a795e1b382c281527f09a353e2a34ad0af28688dbf4c01cc7de2c9878d6a1b80ce58e567d6c48b5bec818301526101c0830152825180840184527f1a65519a1ab82173d9cb9dc061f62c9d53ef95915b0cc76feb9feb90351e810d81527f29c0afd9c7eeae8e1635b3835090d59d5344bd56cf3c71487adcf6d8c5844348818301526101e0830152825180840184527f139c2f5bba86aea351df6608e3f1cd26b3c0b4371dca357e701a6025f94be1e781527f22399eb57ad19a4409a194335726da4d76a0cf2d0d89a50dbc7f687de1aad8c381830152610200830152825180840184527f0ff16a5ae01ecffc7815eb75c174ad14281aa49059929907518634d841c628f581527f2d867f1d311969273bc82b184e63d9269b182a881d3b302b242a4dc93462f7b781830152610220830152825180840184527f0821760c77fc15784afcaff815f73f8f90aa38ebe34d3b48695e3a6ad08ed8b081527f2f51bc8941e5c577f7ec1d5bb038bd902c7a5c7dd1389bab38b9c89ec4ab7d2981830152610240830152825180840184527f0ffd51787978d66be3b7e70e810c4575178c9f45674db1b870595ce7e2fb5f6f81527f17a63d56e53061da2fe13b311859cb536d18d6060100c393c5bb9251dfbad74a81830152610260830152825180840184527f024dcf715a66fd964f629553ae2bcb51c127b813ed7f9a4b28b481fb9e2c377281527f20244a5d7222400941070d0355a58d34ab8ff9b0d8935fd8c9225059f13fcaac81830152610280830152825180840184527f02987fe7cdb3cab8ebf18ecc8711b792828a0670bd9bcd17442c4a157325c8ef81527f1c9fa626c623b3102d77b2878a9de76dd9a1837521baa49c6874797a8e5a9626818301526102a0830152825180840184527f130b070560870337eb165683645e3c8522d6449e1367a35c5cf00dd4462fd96781527f01fe23c3926178b337c362c53b74d2233d08cf587bb0f114ebfe21542c9645e5818301526102c0830152825180840184527f153a7f8639e06461474e00018cde1ac1acf38089893c5515de20804922c0321981527f0939c3d22ab03cefb504fe214af93d65912ae3750ce6b756b0e02c9ce7a16e68818301526102e0830152825180840184527f234c57b9aab8dfb66855cbb2ed5c7dcaa724527a8b5abae05dbfc771da6679cc81527f22060d556338e2843aed696c8fc98bf0c6d133543b5c8774daf51221e0eafb4481830152610300830152825180840184527f2c931d2ddd0a37bf249ba13d4c0005dcf10f905b44f587692f7e19c4325beece81527f02d3dc1f3ed31519bae6c333e090615800a04cfdc9d6233f823114a44746d50181830152610320830152825180840184527f06246fd4811f690574ddc55745590439a8f73455e78fdd3521d65c7e007e6b4581527f1e132a30f5aa1d892595234280dd91b7728b3dadc7b72e58f2a95148f38ba21081830152610340830152825180840184527f1e0181f12b41a00b4ee891ed5a942bfdbae834b4faf95ce9e9aaa9bd2500ce6381527f1b6f032aa6b07625de54649d25628c9a5c45ab7c6c13a88fdd31ca7ecce024af81830152610360830152825180840184527f19b09aa2fcb34ae480845aa4ad56e01616ae845300e6f676fdb84f4bd396851b81527f295d8a6bfcce573b23d5eefd0aab6d32479423acd4956ce6deb5a67073f032d58183015261038083015282518084019093527f08d314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b83527f0100000000000000000000000000000000000000000000000000000000000000908301526103a081019190915290565b6000610b6c7f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000183615d1b565b600080808080612216866003615c5f565b61222190600c615c5f565b67ffffffffffffffff81111561223957612239615d2f565b604051908082528060200260200182016040528015612262578160200160208202803683370190505b509050886000015160001b8160008151811061228057612280615c72565b602002602001018181525050886020015160001b816001815181106122a7576122a7615c72565b602002602001018181525050886040015160001b816002815181106122ce576122ce615c72565b60200260200101818152505060005b8681101561232f578888828181106122f7576122f7615c72565b905060200201358282600361230c9190615c5f565b8151811061231c5761231c615c72565b60209081029190910101526001016122dd565b5060608901515181612342886003615c5f565b8151811061235257612352615c72565b60209081029190910181019190915260608a0151015181612374886003615c5f565b61237f906001615c5f565b8151811061238f5761238f615c72565b6020908102919091010152606089015160400151816123af886003615c5f565b6123ba906002615c5f565b815181106123ca576123ca615c72565b60209081029190910101526060808a01510151816123e9886003615c5f565b6123f4906003615c5f565b8151811061240457612404615c72565b602090810291909101015260808901515181612421886003615c5f565b61242c906004615c5f565b8151811061243c5761243c615c72565b60209081029190910181019190915260808a015101518161245e886003615c5f565b612469906005615c5f565b8151811061247957612479615c72565b602090810291909101015260808901516040015181612499886003615c5f565b6124a4906006615c5f565b815181106124b4576124b4615c72565b6020908102919091010152608089015160600151816124d4886003615c5f565b6124df906007615c5f565b815181106124ef576124ef615c72565b602090810291909101015260a0890151518161250c886003615c5f565b612517906008615c5f565b8151811061252757612527615c72565b60209081029190910181019190915260a08a0151015181612549886003615c5f565b612554906009615c5f565b8151811061256457612564615c72565b602090810291909101015260a08901516040015181612584886003615c5f565b61258f90600a615c5f565b8151811061259f5761259f615c72565b602090810291909101015260a089015160600151816125bf886003615c5f565b6125ca90600b615c5f565b815181106125da576125da615c72565b602002602001018181525050612615816040516020016125fa9190615d5e565b604051602081830303815290604052805190602001206121d9565b9150612620826136a0565b604080516020810186905292975090955061263b91016125fa565b91506000612648836136a0565b50959a949950949750909550919350505050565b600080600061266961590d565b8581526101008581018051516020808501919091528151810151604080860191909152825181015160608087019190915292518301516080860152610120808a0180515160a0880152805184015160c080890191909152815184015160e089015290518501519587019590955293890180515194860194909452835182015161014086015283518101516101608601529251909101516101808401529051612717916125fa91849101615d94565b9150612722826136a0565b90979096509194509092505050565b61273961592c565b600061274361594b565b8481526101408401805151602080840191909152815181015160408085019190915282518101516060808601919091529251830151608085015260e080880180515160a0870152805184015160c0870152805183015191860191909152519092015161010084015290516127bd916125fa91849101615dc9565b91506127c8826136a0565b6020850152835260015b6127de60026019615dfe565b81101561285e576127fb836040516020016125fa91815260200190565b9250612806836136a0565b85612812846002615c48565b6019811061282257612822615c72565b6020020186612832856002615c48565b61283d906001615c5f565b6019811061284d5761284d615c72565b6020020191909152526001016127d2565b50612875826040516020016125fa91815260200190565b91506000612882836136a0565b8561288f60016019615ca1565b6019811061289f5761289f615c72565b60200201919091525050509250929050565b6128b961596a565b6000805b601c81101561290d576128dc846040516020016125fa91815260200190565b935060006128e9856136a0565b8584601c81106128fb576128fb615c72565b602002019190915250506001016128bd565b5090929050565b61291c61596a565b6000805b601c8110156129e25761293161594b565b84815260005b600881101561299b5786610160015183601c811061295757612957615c72565b6020020151816008811061296d5761296d615c72565b60200201518261297e836001615c5f565b6009811061298e5761298e615c72565b6020020152600101612937565b506129b0816040516020016125fa9190615dc9565b945060006129bd866136a0565b8685601c81106129cf576129cf615c72565b6020020191909152505050600101612920565b50909391925050565b6000806129f6615989565b83815260005b602c811015612a4a5785610180015181602c8110612a1c57612a1c615c72565b602002015182612a2d836001615c5f565b602d8110612a3d57612a3d615c72565b60200201526001016129fc565b50612a5f816040516020016125fa9190615e12565b91506000612a6c836136a0565b5096929550919350505050565b600080612a846159a8565b83815260005b612a966001601c615ca1565b811015612bd457856101a0015181601b8110612ab457612ab4615c72565b60200201515182612ac6836004615c48565b612ad1906001615c5f565b606d8110612ae157612ae1615c72565b60200201526101a086015181601b8110612afd57612afd615c72565b60200201516020015182826004612b149190615c48565b612b1f906002615c5f565b606d8110612b2f57612b2f615c72565b60200201526101a086015181601b8110612b4b57612b4b615c72565b60200201516040015182612b60836004615c48565b612b6b906003615c5f565b606d8110612b7b57612b7b615c72565b60200201526101a086015181601b8110612b9757612b97615c72565b60200201516060015182612bac836004615c48565b612bb7906004615c5f565b606d8110612bc757612bc7615c72565b6020020152600101612a8a565b50612a5f816040516020016125fa9190615e47565b600080612bf46159c7565b83815260005b601c811015612c4857856101c0015181601c8110612c1a57612c1a615c72565b602002015182612c2b836001615c5f565b601d8110612c3b57612c3b615c72565b6020020152600101612bfa565b50612a5f816040516020016125fa9190615e7c565b600080612c686159e6565b8381526101e085018051516020808401919091528151810151604080850191909152825181015160608086019190915292519092015160808401529051612a5f916125fa91849101615eb1565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284099392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018284089392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001612d5c837f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b84089392505050565b6000612d7483610c6884613170565b9392505050565b81516000908190612d94908560015b6020020151612ce2565b929092149392505050565b6000806040518061010001604052807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffec5181526020016102d081526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff118152602001609081526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff71815260200160f081526020017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593effffd3181526020016113b081525090506000604051806101000160405280600081526020016001815260200160028152602001600381526020016004815260200160058152602001600681526020016007815250905060006001905060005b6008811015612ed457612eca82610c688884612d0f565b9150600101612eb3565b50612edd615a04565b60005b6008811015612f56576000858260088110612efd57612efd615c72565b60200201519050612f2881610c688a888660088110612f1e57612f1e615c72565b6020020151612d0f565b9050612f3381613170565b905080838360088110612f4857612f48615c72565b602002015250600101612ee0565b5060005b6008811015612fab576000888260088110612f7757612f77615c72565b60200201519050612f9481848460088110610e6457610e64615c72565b9050612fa08782612ce2565b965050600101612f5a565b50612fb68583612cb5565b979650505050505050565b600080612ff26001610c6d86610c688a60c0015188601c8110612fe657612fe6615c72565b60200201516001612d0f565b9050610de18582612cb5565b61018083015160009061300f615a23565b61301a8282866136da565b6130268286838761388b565b61303282868387613a79565b61303d828286613c80565b613048828286613e72565b613054828683876141d1565b61305f828286614ade565b61306a828286614eba565b610de1818660a001516151bc565b61308061596a565b81815260015b601c8110156130d7576130b88261309e600184615ca1565b601c81106130ae576130ae615c72565b6020020151613230565b8282601c81106130ca576130ca615c72565b6020020152600101613086565b50919050565b6130e56159c7565b6101608301516130ff6130fa82856000612f1e565b613170565b825260005b601c81101561316857600061311b60126001615c5f565b821161313d5761313a6130fa848785601c8110612d8a57612d8a615c72565b90505b808461314a846001615c5f565b601d811061315a5761315a615c72565b602002015250600101613104565b505092915050565b6000808290506000604051602081526020808201526020604082015282606082015260027f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000010360808201527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000160a08201526020600060c08360055afa9050806131f857600080fd5b50506000519392505050565b6000610b6c827f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b6000610b6c8283612cb5565b6000601c5b801561333757600083613255600184615ca1565b601c811061326557613265615c72565b6020020151905060008760e001516001846132809190615ca1565b601c811061329057613290615c72565b602002015190506000866132a5600186615ca1565b601c81106132b5576132b5615c72565b6020020151905060006132f16132d56132ce868c612cb5565b6002612cb5565b610c8c84610c686132eb89610c6860018b612d0f565b88612d0f565b905061331281610c686130fa61330c88610c6860018a612d0f565b87612ce2565b90506012851180613321578199505b50505050508061333090615ee5565b9050613241565b5092949350505050565b60408051808201909152600080825260208201526000613363601c602c615c5f565b61336e906002615c5f565b90506001604051855151604082015285516020015160608201528451608082015260408160606040840160075afa8216915060015b838110156133fc5760208102870160208202870181515160408501528151602001516060850152805160808501525050604080830160606040850160075afa8316925060408260808460065afa909216916001016133a3565b50805184526020810151602085015250505092915050565b60408051808201909152600080825260208201527f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4782602001517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476134799190615ca1565b6134839190615d1b565b60208301525090565b81516020808401518351848301516040805194850195909552938301919091527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c260608301527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed60808301527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b60a08301527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60c083015260e08201526101008101919091527f260e01b251f6f1c7e7ff4e580791dee8ea51d87a358e038b4efe30fac09383c16101208201527f0118c4d5b837bcc2bc89b5b398b5974e9f5944073b32078b7e231fec938883b06101408201527f04fc6369f7110fe3d25156c1bb9a72859cf2a04641f99ba4ee413c80da6a5fe46101608201527f22febda3c0c0632a56475b4214e5615e11e6dd3f96e6cea2854a87d4dacc5e5561018082015260009081906101a0016040516020818303038152906040529050600080600873ffffffffffffffffffffffffffffffffffffffff16836040516136319190615f1a565b600060405180830381855afa9150503d806000811461366c576040519150601f19603f3d011682016040523d82523d6000602084013e613671565b606091505b509150915060008180602001905181019061368c9190615f49565b9050828015612fb657509695505050505050565b600080826fffffffffffffffffffffffffffffffff8116608082901c6136c5826121d9565b94506136d0816121d9565b9350505050915091565b60006136e7846006615222565b90507f183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f8000000600061374a61374461371d856003612d0f565b610c6861373961372e8b6000615222565b610c688c601c615222565b610c688b601b615222565b83612cb5565b90506137cb6137c06137a761378e61377585610c6d61376a8d6002615222565b610c688e601b615222565b610c6d6137838c6003615222565b610c688d601c615222565b610c6d61379c8b6004615222565b610c688c601d615222565b610c6d6137b58a6005615222565b610c688b601e615222565b610c6d886001615222565b90506137ea81610c6d6137df866001612d0f565b610c688a602a615222565b90506137f68184612cb5565b90506138028185612cb5565b8552506000905061383e61383361382861381d88601b615222565b610c6d89601e615222565b610c8c886027615222565b610c6d876000615222565b905061384f81610c68846002612d0f565b905061386081610c68846001612d0f565b905061386c8183612cb5565b90506138788184612cb5565b9050808460015b60200201525050505050565b60008060006138c36138b96138a189601b615222565b610c6d6138af8b6011615222565b8a60600151612cb5565b8760800151612ce2565b90506138fc81610c686138f26138da8b601c615222565b610c6d6138e88d6012615222565b8c60600151612cb5565b8960800151612ce2565b905061392181610c686138f26139138b601d615222565b610c6d6138e88d6013615222565b905061394681610c686138f26139388b601e615222565b610c6d6138e88d6014615222565b92506000905061396b6138b961395d89601b615222565b610c6d6138af8b600d615222565b905061399081610c686138f26139828b601c615222565b610c6d6138e88d600e615222565b90506139b581610c686138f26139a78b601d615222565b610c6d6138e88d600f615222565b90506139da81610c686138f26139cc8b601e615222565b610c6d6138e88d6010615222565b915060009050613a026139fc6139f189601f615222565b610c6d8a6019615222565b84612cb5565b9050613a3881610c8c613a32613a198b602b615222565b610c6d613a278d601a615222565b8c6101800151612cb5565b85612cb5565b9050613a448185612cb5565b6040860152506000613a68613a32613a5d89601a615222565b610c688a602b615222565b606090950194909452505050505050565b600080613ad8613ac0613aa8613a936138f28a6015615222565b610c6d613aa18b6016615222565b8a51612cb5565b610c6d613ab68a6017615222565b8960200151612cb5565b610c6d613ace896018615222565b8860400151612cb5565b91506000613b10613af7613aed89601b615222565b8860800151612ce2565b610c6d613b058a6003615222565b610c688b6027615222565b90506000613b3b613b2289601c615222565b610c6d613b308b6000615222565b610c688c6028615222565b90506000613b66613b4d8a601d615222565b610c6d613b5b8c6001615222565b610c688d6029615222565b9050613ba6613b8e613b8085610c6d868d60000151612cb5565b610c6d848c60200151612cb5565b610c6d613b9c8c6004615222565b8b60400151612cb5565b93505050506000613bbb6139fc886020615222565b90506000613bcd6139fc896020615222565b90506000613c06613bed613be28b6022615222565b610c6d8c600a615222565b610c8c613bfb8c6022615222565b610c688d600a615222565b90506000613c2b613c25613c1a8789612cb5565b610c688d6020615222565b83612d0f565b9050613c378188612cb5565b90506000613c60613c52613c4c8d600a615222565b87612cb5565b610c8c613c4c8e6021615222565b60808a018390529050808960055b60200201525050505050505050505050565b6000613c8e60006001612d0f565b90506000613c9e60006002612d0f565b90506000613cae60006003612d0f565b90506000613ccb613cc088601c615222565b610c8c89601b615222565b90506000613ce8613cdd89601d615222565b610c8c8a601c615222565b90506000613d05613cfa8a601e615222565b610c8c8b601d615222565b90506000613d22613d178b6027615222565b610c8c8c601e615222565b905083613d3381610c68818b612ce2565b9050613d4381610c68878a612ce2565b9050613d5381610c688789612ce2565b9050613d6481610c688d6007615222565b9050613d70818a612cb5565b60c08b01525082613d8581610c68818b612ce2565b9050613d9581610c68868a612ce2565b9050613da581610c688689612ce2565b9050613db681610c688d6007615222565b9050613dc2818a612cb5565b60e08b01525081613dd781610c68818b612ce2565b9050613de781610c68858a612ce2565b9050613df781610c688589612ce2565b9050613e0881610c688d6007615222565b9050613e14818a612cb5565b6101008b01525080613e2a81610c68818b612ce2565b9050613e3a81610c68848a612ce2565b9050613e4a81610c688489612ce2565b9050613e5b81610c688d6007615222565b9050613e67818a612cb5565b9050808a6009613c6e565b613eb26040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b613ebd84601c615222565b8152613eca84601d615222565b6020820152613eda846027615222565b6040820152613eea84602a615222565b6060820152613efa846029615222565b6080820152613f0a846028615222565b60a08201526000613f1c856002615222565b90506000613f2b866000615222565b90506000613f4184604001518560000151612d0f565b90506000613f5785602001518660200151612cb5565b60608601519091508690600090613f6e9080612cb5565b90506000613f8d613f8789602001518a60600151612cb5565b88612cb5565b90506000613fad613fa68a60a001518b60400151612ce2565b8a51612ce2565b9050613fbc613c4c8288612cb5565b9050613fdd613fd7613fd16132eb8487612d0f565b84612ce2565b83612ce2565b9050614005613ffa613fef8387612cb5565b610c688f6008615222565b610c6860018a612d0f565b6101408c0152505050506020850151608086015160009161402591612ce2565b9050600061404461403a886060015188612cb5565b8860200151612d0f565b9050600061406a6140558487612cb5565b610c6d613a328b60a001518c60000151612d0f565b905061409261408761407c838c612cb5565b610c688e6008615222565b610c68600189612d0f565b6101608b015250600091506140b490506140ad836011612ce2565b8751612cb5565b905060006140c28384612ce2565b90506140ce8182612ce2565b905060006140dd836009612cb5565b90506141076141016139fc6140fa8b60a001518c60000151612ce2565b8b51612ce2565b82612d0f565b60c0890181905260009061412390613f8790613fef908d612cb5565b90506141368b600a602002015182612ce2565b6101408c0152505086516000925061415e91506140ad906141579080612ce2565b8851612ce2565b905060006141a061417b83610c688a600001518b60a00151612d0f565b6020890151610c8c9061418e9080612ce2565b610c688b602001518c60800151612ce2565b90506141bd89600b6020020151610c6d613f87613fef858d612cb5565b89600b602002015250505050505050505050565b61427b604051806102c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6142b061429761428c87601b615222565b610c68886028615222565b610c6d6142a5886027615222565b610c6889601c615222565b81526142f56142ea6142d16142c688601b615222565b610c6889601e615222565b610c6d6142df89601c615222565b610c688a601d615222565b610c8c876029615222565b6040820181905261430f9068100000000000000000612cb5565b6040820181905261432590610c8c87602a615222565b6040820181905281516143389190612ce2565b6040820181905261434e90610c68876005615222565b604082015280516143689068100000000000000000612cb5565b80825261438890610c6d61437d886027615222565b610c68896028615222565b808252602082018190526143a490610c8c61381d88601d615222565b602082018190526143ba90610c68876004615222565b60208201528051606082018190526143d790610c6d87601e615222565b606082018190526143fb90610c8c6143f0886029615222565b610c6d89602a615222565b6060820181905261441190610c68876000615222565b816060018181525050600061443b61443183602001518460400151612ce2565b8360600151612ce2565b905061444c81610c68886003615222565b905061446461445c876028615222565b614000612cb5565b6080830181905261447a90610c6d886027615222565b6080830181905261448d90614000612cb5565b608083018190526144a390610c6d88601d615222565b608083018190526144b690614000612cb5565b608083018190526144cc90610c6d88601c615222565b608083018190526144df90614000612cb5565b608083018190526144f590610c6d88601b615222565b6080830181905261450b90610c8c88601e615222565b6080830181905261452190610c68886005615222565b608083015261453461445c876029615222565b60a0830181905261454a90610c6d886028615222565b60a0830181905261455d90614000612cb5565b60a0830181905261457390610c6d886027615222565b60a0830181905261458690614000612cb5565b60a0830181905261459c90610c6d88601e615222565b60a083018190526145af90614000612cb5565b60a083018190526145c590610c6d88601d615222565b60a083018190526145db90610c8c88602a615222565b60a083018190526145f190610c68886000615222565b60a08301819052608083015160009161460a9190612ce2565b905061461b81610c68896004615222565b905061463561462b88601d615222565b8760400151612cb5565b60c0840181905261464e90610c6d613ab68a601c615222565b60c0840181905261466e90610c6d6146678a601b615222565b8951612cb5565b60c0840181905261468490610c6d896001615222565b60c0840181905260e084018190526146a190610c8c89601e615222565b60c08401526146b4613cc0886027615222565b6101408401526146d36146c888602a615222565b610c8c89601e615222565b6101208401526101408301516146f8906146ed9080612cb5565b846101400151612d0f565b61028084015261014083015161474d906147429061473b90610c6860017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b6001612ce2565b846101200151612cb5565b61016084018190526147849061477690610c6861476b8b6002615222565b610c688c6003615222565b610c68613c4c8a6009615222565b6101a08601526102808301516147a69061477690610c6861476b8b6002615222565b6101c086015260c08301516147ce90610c686147c38a6002615222565b610c688b6003615222565b6101e084015260006147ee6147e489601e615222565b8560e00151612d0f565b90506147fd6141018283612cb5565b6101a0850152614811613ace896029615222565b610100850181905261483590610c6d61482b8b6028615222565b8a60200151612cb5565b610100850181905261484f90610c6d613aa18b6027615222565b61010085015261486e61486389602a615222565b856101000151612d0f565b6101008501526000614884613cfa8a6029615222565b90506148fe6148c561374461473b88610140015160017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001610c689190615ca1565b610c6861473b88610100015160017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001610c689190615ca1565b610180860152610100850151614923906149189080612cb5565b866101000151612d0f565b6101c08601526101808501516149569061494290610c688c6006615222565b610c686149508c6009615222565b89612cb5565b6101e08801526102808501516149759061494290610c688c6006615222565b6102008801526101c08501516149949061494290610c688c6006615222565b6102208801526101a08501516149af90610c688b6006615222565b6102008601526149ce6149c38a6028615222565b610c8c8b601c615222565b610220860152610140850151614a2090613cfa90614a159061473b90610c6860017f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001615ca1565b876102200151612cb5565b61024086018190526101e08601516102608701819052614a5791610c6d90610c68614a4c8e6005615222565b610c688f6002615222565b610260860181905260c0860151614a7b9190610c6d90610c68614a4c8e6000615222565b6102608601819052610200860151614a939190612ce2565b6102608601819052614aa990613fd19086612ce2565b6102a08601819052614ac390610c686149508c6009615222565b6102a0860181905287600c6020020152505050505050505050565b614b6560405180610220016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b614b7e614b7385601b615222565b610c6d866002615222565b8152614b99614b8e85601c615222565b610c6d866003615222565b6020820152614bb7614bac85601d615222565b610c6d866004615222565b6040820152614bd5614bca85601e615222565b610c6d866005615222565b60608201528051614c0790614c0090614bf990614bf29080612cb5565b8451612cb5565b8351612cb5565b8251612cb5565b60808201526020810151614c4590614c3b90614c3190614c279080612cb5565b8460200151612cb5565b8360200151612cb5565b8260200151612cb5565b60a08201526040810151614c8390614c7990614c6f90614c659080612cb5565b8460400151612cb5565b8360400151612cb5565b8260400151612cb5565b60c08201526060810151614cc190614cb790614cad90614ca39080612cb5565b8460600151612cb5565b8360600151612cb5565b8260600151612cb5565b60e0820152608081015160a0820151614cda9190612ce2565b61010082015260c081015160e0820151614cf49190612ce2565b61012082015260a0810151614d1890614d0d9080612ce2565b826101200151612ce2565b61014082015260e0810151614d3c90614d319080612ce2565b826101000151612ce2565b610160820152610120810151614d529080612ce2565b6101e08201819052614d7390614d689080612ce2565b826101600151612ce2565b6101e0820152610100810151614d899080612ce2565b6101a08201819052614daa90614d9f9080612ce2565b826101400151612ce2565b6101a08201819052610160820151614dc191612ce2565b6101808201526101408101516101e0820151614ddd9190612ce2565b6101c0820152614df161374485600b615222565b6102008201819052610240840151610180830151614e1c92610c6d91610c6890610c8c8a6027615222565b8360126020020152614e4c8360136020020151610c6d836102000151610c68856101a00151610c8c8a6028615222565b8360136020020152614e7c8360146020020151610c6d836102000151610c68856101c00151610c8c8a6029615222565b8360146020020152614eac8360156020020151610c6d836102000151610c68856101e00151610c8c8a602a615222565b836015602002015250505050565b614f1760405180610160016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60006040518060800160405280614f4d7f10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e76121d9565b8152602001614f7b7f0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b6121d9565b8152602001614fa87e544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac156121d9565b8152602001614fd67f222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b6121d9565b90529050614ff3614fe886601b615222565b610c6d876002615222565b61012083018190526150279061501c90614742906150119080612cb5565b856101200151612cb5565b836101200151612cb5565b825261503485601c615222565b602083015261504485601d615222565b604083015261505485601e615222565b60608301528151602083015161507c91614431916150729190612ce2565b8460400151612ce2565b608083015261508f6139fc86600c615222565b61014083015281516150b1906150a790836000610e64565b8360800151612ce2565b60a08301526150dd8460166020020151610c6d846101400151610c688660a00151610c8c8b6027615222565b6102c085015260208201516150f8906150a790836001610e64565b60c08301526151248460176020020151610c6d846101400151610c688660c00151610c8c8b6028615222565b6102e0850152604082015161513f906150a790836002610e64565b60e083015261516b8460186020020151610c6d846101400151610c688660e00151610c8c8b6029615222565b6103008501526060820151615186906150a790836003610e64565b6101008301526151b48460196020020151610c6d846101400151610c68866101000151610c8c8b602a615222565b84601961387f565b60006151c9818481612d8a565b905060015b601a81101561521b5761521182610c6d8684601a81106151f0576151f0615c72565b602002015186615201600187615ca1565b60198110610e6457610e64615c72565b91506001016151ce565b5092915050565b60008282602b81111561523757615237615f6b565b602c811061524757615247615c72565b60200201519392505050565b604051806103c00160405280600081526020016000815260200160008152602001615291604051806040016040528060008152602001600081525090565b81526020016152b3604051806040016040528060008152602001600081525090565b81526020016152d5604051806040016040528060008152602001600081525090565b81526020016152f7604051806040016040528060008152602001600081525090565b8152602001615319604051806040016040528060008152602001600081525090565b815260200161533b604051806040016040528060008152602001600081525090565b815260200161535d604051806040016040528060008152602001600081525090565b815260200161537f604051806040016040528060008152602001600081525090565b81526020016153a1604051806040016040528060008152602001600081525090565b81526020016153c3604051806040016040528060008152602001600081525090565b81526020016153e5604051806040016040528060008152602001600081525090565b8152602001615407604051806040016040528060008152602001600081525090565b8152602001615429604051806040016040528060008152602001600081525090565b815260200161544b604051806040016040528060008152602001600081525090565b815260200161546d604051806040016040528060008152602001600081525090565b815260200161548f604051806040016040528060008152602001600081525090565b81526020016154b1604051806040016040528060008152602001600081525090565b81526020016154d3604051806040016040528060008152602001600081525090565b81526020016154f5604051806040016040528060008152602001600081525090565b8152602001615517604051806040016040528060008152602001600081525090565b8152602001615539604051806040016040528060008152602001600081525090565b815260200161555b604051806040016040528060008152602001600081525090565b815260200161557d604051806040016040528060008152602001600081525090565b815260200161559f604051806040016040528060008152602001600081525090565b81526020016155c1604051806040016040528060008152602001600081525090565b81526020016155e3604051806040016040528060008152602001600081525090565b8152602001615605604051806040016040528060008152602001600081525090565b905290565b6040518061022001604052806000815260200160008152602001600081526020016156566040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156866040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156b66040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156e66040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157166040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157466040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157766040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157a66040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016157b3615a42565b81526020016157c0615a70565b81526020016157cd615a8f565b81526020016157da61596a565b815260200161580a6040518060800160405280600081526020016000815260200160008152602001600081525090565b81526020016156056040518060800160405280600081526020016000815260200160008152602001600081525090565b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200161587161592c565b815260200161587e61596a565b815260200161588b61596a565b815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806109400160405280604a906020820280368337509192915050565b604051806109400160405280604a905b60408051808201909152600080825260208201528152602001906001900390816158e35790505090565b604051806101a00160405280600d906020820280368337509192915050565b6040518061032001604052806019906020820280368337509192915050565b6040518061012001604052806009906020820280368337509192915050565b604051806103800160405280601c906020820280368337509192915050565b604051806105a00160405280602d906020820280368337509192915050565b60405180610da00160405280606d906020820280368337509192915050565b604051806103a00160405280601d906020820280368337509192915050565b6040518060a001604052806005906020820280368337509192915050565b6040518061010001604052806008906020820280368337509192915050565b604051806103400160405280601a906020820280368337509192915050565b604051806103800160405280601c905b615a5a615a04565b815260200190600190039081615a525790505090565b604051806105800160405280602c906020820280368337509192915050565b604051806103600160405280601b905b615aca6040518060800160405280600081526020016000815260200160008152602001600081525090565b815260200190600190039081615a9f5790505090565b60008060008060408587031215615af657600080fd5b843567ffffffffffffffff811115615b0d57600080fd5b8501601f81018713615b1e57600080fd5b803567ffffffffffffffff811115615b3557600080fd5b876020828401011115615b4757600080fd5b60209182019550935085013567ffffffffffffffff811115615b6857600080fd5b8501601f81018713615b7957600080fd5b803567ffffffffffffffff811115615b9057600080fd5b8760208260051b8401011115615ba557600080fd5b949793965060200194505050565b60008085851115615bc357600080fd5b83861115615bd057600080fd5b5050820193919092039150565b80356020831015610b6c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082028115828204841417610b6c57610b6c615c19565b80820180821115610b6c57610b6c615c19565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610b6c57610b6c615c19565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615ce557615ce5615c19565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082615d2a57615d2a615cec565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8151600090829060208501835b82811015615d89578151845260209384019390910190600101615d6b565b509195945050505050565b60008183825b600d811015615db9578151835260209283019290910190600101615d9a565b5050506101a08201905092915050565b60008183825b6009811015615dee578151835260209283019290910190600101615dcf565b5050506101208201905092915050565b600082615e0d57615e0d615cec565b500490565b60008183825b602d811015615e37578151835260209283019290910190600101615e18565b5050506105a08201905092915050565b60008183825b606d811015615e6c578151835260209283019290910190600101615e4d565b505050610da08201905092915050565b60008183825b601d811015615ea1578151835260209283019290910190600101615e82565b5050506103a08201905092915050565b60008183825b6005811015615ed6578151835260209283019290910190600101615eb7565b50505060a08201905092915050565b600081615ef457615ef4615c19565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6000825160005b81811015615f3b5760208186018101518583015201615f21565b506000920191825250919050565b600060208284031215615f5b57600080fd5b81518015158114612d7457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220713aa0ceca32cc201db9cc83c7b665d6bec0c53ae3338734af7de9935d933c1964736f6c634300081b0033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/baseSepolia/SimpleAccountFactory.json b/packages/contracts/deployments/baseSepolia/SimpleAccountFactory.json index 0a6efeb..fe93475 100644 --- a/packages/contracts/deployments/baseSepolia/SimpleAccountFactory.json +++ b/packages/contracts/deployments/baseSepolia/SimpleAccountFactory.json @@ -1,5 +1,5 @@ { - "address": "0x993559431A2d6d3526a11604b5b7B5DE75fEc267", + "address": "0xa712976C582ACa81e2800eF27afcdf157252aAdf", "abi": [ { "inputs": [ @@ -45,7 +45,7 @@ "type": "address" }, { - "internalType": "contract UltraVerifier", + "internalType": "contract HonkVerifier", "name": "proofVerifier", "type": "address" } @@ -86,7 +86,7 @@ "type": "address" }, { - "internalType": "contract UltraVerifier", + "internalType": "contract HonkVerifier", "name": "proofVerifier", "type": "address" } @@ -108,43 +108,43 @@ "type": "function" } ], - "transactionHash": "0x38c02bd87245401c77a26594d8fa2624cc99b7ac727241a19a03780933b69f85", + "transactionHash": "0x01ea9af0f4e0b05c66f9f525798a91790f21b03809a625eeab877516c685492e", "receipt": { "to": null, "from": "0xEE0A4782efd390120A29F050A76B297D078e1df9", - "contractAddress": "0x993559431A2d6d3526a11604b5b7B5DE75fEc267", - "transactionIndex": 4, - "gasUsed": "2888288", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000002000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xc7db6e9dddea5a3913979d67a2a0dcedb2c1dbd912333f0f226dcc4448ef54f4", - "transactionHash": "0x38c02bd87245401c77a26594d8fa2624cc99b7ac727241a19a03780933b69f85", + "contractAddress": "0xa712976C582ACa81e2800eF27afcdf157252aAdf", + "transactionIndex": 2, + "gasUsed": "2888300", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000200000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4667e5755c1bc21101b44c095c8c7f9a1dfe319bb5531f21d4c5fc7610db5bbf", + "transactionHash": "0x01ea9af0f4e0b05c66f9f525798a91790f21b03809a625eeab877516c685492e", "logs": [ { - "transactionIndex": 4, - "blockNumber": 18953183, - "transactionHash": "0x38c02bd87245401c77a26594d8fa2624cc99b7ac727241a19a03780933b69f85", - "address": "0x2aA2EFD0B1a7266b7e9AF8ADca0eBCe4aeD8ACDA", + "transactionIndex": 2, + "blockNumber": 18975459, + "transactionHash": "0x01ea9af0f4e0b05c66f9f525798a91790f21b03809a625eeab877516c685492e", + "address": "0xb8c5C311A8fA7D767f52A7FBE6021fe609c9f70E", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", - "logIndex": 3, - "blockHash": "0xc7db6e9dddea5a3913979d67a2a0dcedb2c1dbd912333f0f226dcc4448ef54f4" + "logIndex": 0, + "blockHash": "0x4667e5755c1bc21101b44c095c8c7f9a1dfe319bb5531f21d4c5fc7610db5bbf" } ], - "blockNumber": 18953183, - "cumulativeGasUsed": "3087907", + "blockNumber": 18975459, + "cumulativeGasUsed": "2953723", "status": 1, "byzantium": true }, "args": [ "0x0000000071727De22E5E9d8BAf0edAc6f37da032" ], - "numDeployments": 18, - "solcInputHash": "2d4f9a4116da018bc80768e7806f1b6e", - "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IEntryPoint\",\"name\":\"_entryPoint\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"accountImplementation\",\"outputs\":[{\"internalType\":\"contract SimpleAccount\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"accountId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"authProviderId\",\"type\":\"bytes32\"},{\"internalType\":\"contract PublicKeyRegistry\",\"name\":\"publicKeyRegistry\",\"type\":\"address\"},{\"internalType\":\"contract UltraVerifier\",\"name\":\"proofVerifier\",\"type\":\"address\"}],\"internalType\":\"struct ZkLogin.AccountData\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"createAccount\",\"outputs\":[{\"internalType\":\"contract SimpleAccount\",\"name\":\"ret\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"accountId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"authProviderId\",\"type\":\"bytes32\"},{\"internalType\":\"contract PublicKeyRegistry\",\"name\":\"publicKeyRegistry\",\"type\":\"address\"},{\"internalType\":\"contract UltraVerifier\",\"name\":\"proofVerifier\",\"type\":\"address\"}],\"internalType\":\"struct ZkLogin.AccountData\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"getAccountAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createAccount((bytes32,bytes32,address,address))\":{\"notice\":\"create an account, and return its address. returns the address even if the account is already deployed. Note that during UserOperation execution, this method is called only if the account is not deployed. This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation\"},\"getAccountAddress((bytes32,bytes32,address,address))\":{\"notice\":\"calculate the counterfactual address of this account as it would be returned by createAccount()\"}},\"notice\":\"A sample factory contract for SimpleAccount A UserOperations \\\"initCode\\\" holds the address of the factory, and a method call (to createAccount, in this sample factory). The factory's createAccount returns the target account address even if it is already installed. This way, the entryPoint.getSenderAddress() can be called either before or after the account is created.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SimpleAccountFactory.sol\":\"SimpleAccountFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100000000},\"remappings\":[]},\"sources\":{\"@account-abstraction/contracts/core/BaseAccount.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable avoid-low-level-calls */\\n/* solhint-disable no-empty-blocks */\\n\\nimport \\\"../interfaces/IAccount.sol\\\";\\nimport \\\"../interfaces/IEntryPoint.sol\\\";\\nimport \\\"./UserOperationLib.sol\\\";\\n\\n/**\\n * Basic account implementation.\\n * This contract provides the basic logic for implementing the IAccount interface - validateUserOp\\n * Specific account implementation should inherit it and provide the account-specific logic.\\n */\\nabstract contract BaseAccount is IAccount {\\n using UserOperationLib for PackedUserOperation;\\n\\n /**\\n * Return the account nonce.\\n * This method returns the next sequential nonce.\\n * For a nonce of a specific key, use `entrypoint.getNonce(account, key)`\\n */\\n function getNonce() public view virtual returns (uint256) {\\n return entryPoint().getNonce(address(this), 0);\\n }\\n\\n /**\\n * Return the entryPoint used by this account.\\n * Subclass should return the current entryPoint used by this account.\\n */\\n function entryPoint() public view virtual returns (IEntryPoint);\\n\\n /// @inheritdoc IAccount\\n function validateUserOp(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash,\\n uint256 missingAccountFunds\\n ) external virtual override returns (uint256 validationData) {\\n _requireFromEntryPoint();\\n validationData = _validateSignature(userOp, userOpHash);\\n _validateNonce(userOp.nonce);\\n _payPrefund(missingAccountFunds);\\n }\\n\\n /**\\n * Ensure the request comes from the known entrypoint.\\n */\\n function _requireFromEntryPoint() internal view virtual {\\n require(\\n msg.sender == address(entryPoint()),\\n \\\"account: not from EntryPoint\\\"\\n );\\n }\\n\\n /**\\n * Validate the signature is valid for this message.\\n * @param userOp - Validate the userOp.signature field.\\n * @param userOpHash - Convenient field: the hash of the request, to check the signature against.\\n * (also hashes the entrypoint and chain id)\\n * @return validationData - Signature and time-range of this operation.\\n * <20-byte> aggregatorOrSigFail - 0 for valid signature, 1 to mark signature failure,\\n * otherwise, an address of an aggregator contract.\\n * <6-byte> validUntil - last timestamp this operation is valid. 0 for \\\"indefinite\\\"\\n * <6-byte> validAfter - first timestamp this operation is valid\\n * If the account doesn't use time-range, it is enough to return\\n * SIG_VALIDATION_FAILED value (1) for signature failure.\\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\\n */\\n function _validateSignature(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash\\n ) internal virtual returns (uint256 validationData);\\n\\n /**\\n * Validate the nonce of the UserOperation.\\n * This method may validate the nonce requirement of this account.\\n * e.g.\\n * To limit the nonce to use sequenced UserOps only (no \\\"out of order\\\" UserOps):\\n * `require(nonce < type(uint64).max)`\\n * For a hypothetical account that *requires* the nonce to be out-of-order:\\n * `require(nonce & type(uint64).max == 0)`\\n *\\n * The actual nonce uniqueness is managed by the EntryPoint, and thus no other\\n * action is needed by the account itself.\\n *\\n * @param nonce to validate\\n *\\n * solhint-disable-next-line no-empty-blocks\\n */\\n function _validateNonce(uint256 nonce) internal view virtual {\\n }\\n\\n /**\\n * Sends to the entrypoint (msg.sender) the missing funds for this transaction.\\n * SubClass MAY override this method for better funds management\\n * (e.g. send to the entryPoint more than the minimum required, so that in future transactions\\n * it will not be required to send again).\\n * @param missingAccountFunds - The minimum value this method should send the entrypoint.\\n * This value MAY be zero, in case there is enough deposit,\\n * or the userOp has a paymaster.\\n */\\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\\n if (missingAccountFunds != 0) {\\n (bool success, ) = payable(msg.sender).call{\\n value: missingAccountFunds,\\n gas: type(uint256).max\\n }(\\\"\\\");\\n (success);\\n //ignore failure (its EntryPoint's job to verify, not account.)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2736272f077d1699b8b8bf8be18d1c20e506668fc52b3293da70d17e63794358\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/core/Helpers.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable no-inline-assembly */\\n\\n\\n /*\\n * For simulation purposes, validateUserOp (and validatePaymasterUserOp)\\n * must return this value in case of signature failure, instead of revert.\\n */\\nuint256 constant SIG_VALIDATION_FAILED = 1;\\n\\n\\n/*\\n * For simulation purposes, validateUserOp (and validatePaymasterUserOp)\\n * return this value on success.\\n */\\nuint256 constant SIG_VALIDATION_SUCCESS = 0;\\n\\n\\n/**\\n * Returned data from validateUserOp.\\n * validateUserOp returns a uint256, which is created by `_packedValidationData` and\\n * parsed by `_parseValidationData`.\\n * @param aggregator - address(0) - The account validated the signature by itself.\\n * address(1) - The account failed to validate the signature.\\n * otherwise - This is an address of a signature aggregator that must\\n * be used to validate the signature.\\n * @param validAfter - This UserOp is valid only after this timestamp.\\n * @param validaUntil - This UserOp is valid only up to this timestamp.\\n */\\nstruct ValidationData {\\n address aggregator;\\n uint48 validAfter;\\n uint48 validUntil;\\n}\\n\\n/**\\n * Extract sigFailed, validAfter, validUntil.\\n * Also convert zero validUntil to type(uint48).max.\\n * @param validationData - The packed validation data.\\n */\\nfunction _parseValidationData(\\n uint256 validationData\\n) pure returns (ValidationData memory data) {\\n address aggregator = address(uint160(validationData));\\n uint48 validUntil = uint48(validationData >> 160);\\n if (validUntil == 0) {\\n validUntil = type(uint48).max;\\n }\\n uint48 validAfter = uint48(validationData >> (48 + 160));\\n return ValidationData(aggregator, validAfter, validUntil);\\n}\\n\\n/**\\n * Helper to pack the return value for validateUserOp.\\n * @param data - The ValidationData to pack.\\n */\\nfunction _packValidationData(\\n ValidationData memory data\\n) pure returns (uint256) {\\n return\\n uint160(data.aggregator) |\\n (uint256(data.validUntil) << 160) |\\n (uint256(data.validAfter) << (160 + 48));\\n}\\n\\n/**\\n * Helper to pack the return value for validateUserOp, when not using an aggregator.\\n * @param sigFailed - True for signature failure, false for success.\\n * @param validUntil - Last timestamp this UserOperation is valid (or zero for infinite).\\n * @param validAfter - First timestamp this UserOperation is valid.\\n */\\nfunction _packValidationData(\\n bool sigFailed,\\n uint48 validUntil,\\n uint48 validAfter\\n) pure returns (uint256) {\\n return\\n (sigFailed ? 1 : 0) |\\n (uint256(validUntil) << 160) |\\n (uint256(validAfter) << (160 + 48));\\n}\\n\\n/**\\n * keccak function over calldata.\\n * @dev copy calldata into memory, do keccak and drop allocated memory. Strangely, this is more efficient than letting solidity do it.\\n */\\n function calldataKeccak(bytes calldata data) pure returns (bytes32 ret) {\\n assembly (\\\"memory-safe\\\") {\\n let mem := mload(0x40)\\n let len := data.length\\n calldatacopy(mem, data.offset, len)\\n ret := keccak256(mem, len)\\n }\\n }\\n\\n\\n/**\\n * The minimum of two numbers.\\n * @param a - First number.\\n * @param b - Second number.\\n */\\n function min(uint256 a, uint256 b) pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\",\"keccak256\":\"0x6247e011a6cb0b263b3aa098822977181674d91b62e5bdfe04c6e66f72da25d6\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/core/UserOperationLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable no-inline-assembly */\\n\\nimport \\\"../interfaces/PackedUserOperation.sol\\\";\\nimport {calldataKeccak, min} from \\\"./Helpers.sol\\\";\\n\\n/**\\n * Utility functions helpful when working with UserOperation structs.\\n */\\nlibrary UserOperationLib {\\n\\n uint256 public constant PAYMASTER_VALIDATION_GAS_OFFSET = 20;\\n uint256 public constant PAYMASTER_POSTOP_GAS_OFFSET = 36;\\n uint256 public constant PAYMASTER_DATA_OFFSET = 52;\\n /**\\n * Get sender from user operation data.\\n * @param userOp - The user operation data.\\n */\\n function getSender(\\n PackedUserOperation calldata userOp\\n ) internal pure returns (address) {\\n address data;\\n //read sender from userOp, which is first userOp member (saves 800 gas...)\\n assembly {\\n data := calldataload(userOp)\\n }\\n return address(uint160(data));\\n }\\n\\n /**\\n * Relayer/block builder might submit the TX with higher priorityFee,\\n * but the user should not pay above what he signed for.\\n * @param userOp - The user operation data.\\n */\\n function gasPrice(\\n PackedUserOperation calldata userOp\\n ) internal view returns (uint256) {\\n unchecked {\\n (uint256 maxPriorityFeePerGas, uint256 maxFeePerGas) = unpackUints(userOp.gasFees);\\n if (maxFeePerGas == maxPriorityFeePerGas) {\\n //legacy mode (for networks that don't support basefee opcode)\\n return maxFeePerGas;\\n }\\n return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\\n }\\n }\\n\\n /**\\n * Pack the user operation data into bytes for hashing.\\n * @param userOp - The user operation data.\\n */\\n function encode(\\n PackedUserOperation calldata userOp\\n ) internal pure returns (bytes memory ret) {\\n address sender = getSender(userOp);\\n uint256 nonce = userOp.nonce;\\n bytes32 hashInitCode = calldataKeccak(userOp.initCode);\\n bytes32 hashCallData = calldataKeccak(userOp.callData);\\n bytes32 accountGasLimits = userOp.accountGasLimits;\\n uint256 preVerificationGas = userOp.preVerificationGas;\\n bytes32 gasFees = userOp.gasFees;\\n bytes32 hashPaymasterAndData = calldataKeccak(userOp.paymasterAndData);\\n\\n return abi.encode(\\n sender, nonce,\\n hashInitCode, hashCallData,\\n accountGasLimits, preVerificationGas, gasFees,\\n hashPaymasterAndData\\n );\\n }\\n\\n function unpackUints(\\n bytes32 packed\\n ) internal pure returns (uint256 high128, uint256 low128) {\\n return (uint128(bytes16(packed)), uint128(uint256(packed)));\\n }\\n\\n //unpack just the high 128-bits from a packed value\\n function unpackHigh128(bytes32 packed) internal pure returns (uint256) {\\n return uint256(packed) >> 128;\\n }\\n\\n // unpack just the low 128-bits from a packed value\\n function unpackLow128(bytes32 packed) internal pure returns (uint256) {\\n return uint128(uint256(packed));\\n }\\n\\n function unpackMaxPriorityFeePerGas(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackHigh128(userOp.gasFees);\\n }\\n\\n function unpackMaxFeePerGas(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackLow128(userOp.gasFees);\\n }\\n\\n function unpackVerificationGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackHigh128(userOp.accountGasLimits);\\n }\\n\\n function unpackCallGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackLow128(userOp.accountGasLimits);\\n }\\n\\n function unpackPaymasterVerificationGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET]));\\n }\\n\\n function unpackPostOpGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]));\\n }\\n\\n function unpackPaymasterStaticFields(\\n bytes calldata paymasterAndData\\n ) internal pure returns (address paymaster, uint256 validationGasLimit, uint256 postOpGasLimit) {\\n return (\\n address(bytes20(paymasterAndData[: PAYMASTER_VALIDATION_GAS_OFFSET])),\\n uint128(bytes16(paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET])),\\n uint128(bytes16(paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]))\\n );\\n }\\n\\n /**\\n * Hash the user operation data.\\n * @param userOp - The user operation data.\\n */\\n function hash(\\n PackedUserOperation calldata userOp\\n ) internal pure returns (bytes32) {\\n return keccak256(encode(userOp));\\n }\\n}\\n\",\"keccak256\":\"0x9d50ece985d35f82e33e5da417595c86fac10449e3d10895d08363d33aad454b\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IAccount.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\nimport \\\"./PackedUserOperation.sol\\\";\\n\\ninterface IAccount {\\n /**\\n * Validate user's signature and nonce\\n * the entryPoint will make the call to the recipient only if this validation call returns successfully.\\n * signature failure should be reported by returning SIG_VALIDATION_FAILED (1).\\n * This allows making a \\\"simulation call\\\" without a valid signature\\n * Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure.\\n *\\n * @dev Must validate caller is the entryPoint.\\n * Must validate the signature and nonce\\n * @param userOp - The operation that is about to be executed.\\n * @param userOpHash - Hash of the user's request data. can be used as the basis for signature.\\n * @param missingAccountFunds - Missing funds on the account's deposit in the entrypoint.\\n * This is the minimum amount to transfer to the sender(entryPoint) to be\\n * able to make the call. The excess is left as a deposit in the entrypoint\\n * for future calls. Can be withdrawn anytime using \\\"entryPoint.withdrawTo()\\\".\\n * In case there is a paymaster in the request (or the current deposit is high\\n * enough), this value will be zero.\\n * @return validationData - Packaged ValidationData structure. use `_packValidationData` and\\n * `_unpackValidationData` to encode and decode.\\n * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure,\\n * otherwise, an address of an \\\"authorizer\\\" contract.\\n * <6-byte> validUntil - Last timestamp this operation is valid. 0 for \\\"indefinite\\\"\\n * <6-byte> validAfter - First timestamp this operation is valid\\n * If an account doesn't use time-range, it is enough to\\n * return SIG_VALIDATION_FAILED value (1) for signature failure.\\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\\n */\\n function validateUserOp(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash,\\n uint256 missingAccountFunds\\n ) external returns (uint256 validationData);\\n}\\n\",\"keccak256\":\"0x38710bec0cb20ff4ceef46a80475b5bdabc27b7efd2687fd473db68332f61b78\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IAggregator.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\nimport \\\"./PackedUserOperation.sol\\\";\\n\\n/**\\n * Aggregated Signatures validator.\\n */\\ninterface IAggregator {\\n /**\\n * Validate aggregated signature.\\n * Revert if the aggregated signature does not match the given list of operations.\\n * @param userOps - Array of UserOperations to validate the signature for.\\n * @param signature - The aggregated signature.\\n */\\n function validateSignatures(\\n PackedUserOperation[] calldata userOps,\\n bytes calldata signature\\n ) external view;\\n\\n /**\\n * Validate signature of a single userOp.\\n * This method should be called by bundler after EntryPointSimulation.simulateValidation() returns\\n * the aggregator this account uses.\\n * First it validates the signature over the userOp. Then it returns data to be used when creating the handleOps.\\n * @param userOp - The userOperation received from the user.\\n * @return sigForUserOp - The value to put into the signature field of the userOp when calling handleOps.\\n * (usually empty, unless account and aggregator support some kind of \\\"multisig\\\".\\n */\\n function validateUserOpSignature(\\n PackedUserOperation calldata userOp\\n ) external view returns (bytes memory sigForUserOp);\\n\\n /**\\n * Aggregate multiple signatures into a single value.\\n * This method is called off-chain to calculate the signature to pass with handleOps()\\n * bundler MAY use optimized custom code perform this aggregation.\\n * @param userOps - Array of UserOperations to collect the signatures from.\\n * @return aggregatedSignature - The aggregated signature.\\n */\\n function aggregateSignatures(\\n PackedUserOperation[] calldata userOps\\n ) external view returns (bytes memory aggregatedSignature);\\n}\\n\",\"keccak256\":\"0xf100d6fcc0c3b450b13e979b6a42c628c292a1bc340eccc2e7796b80e3975588\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IEntryPoint.sol\":{\"content\":\"/**\\n ** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.\\n ** Only one instance required on each chain.\\n **/\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\n/* solhint-disable avoid-low-level-calls */\\n/* solhint-disable no-inline-assembly */\\n/* solhint-disable reason-string */\\n\\nimport \\\"./PackedUserOperation.sol\\\";\\nimport \\\"./IStakeManager.sol\\\";\\nimport \\\"./IAggregator.sol\\\";\\nimport \\\"./INonceManager.sol\\\";\\n\\ninterface IEntryPoint is IStakeManager, INonceManager {\\n /***\\n * An event emitted after each successful request.\\n * @param userOpHash - Unique identifier for the request (hash its entire content, except signature).\\n * @param sender - The account that generates this request.\\n * @param paymaster - If non-null, the paymaster that pays for this request.\\n * @param nonce - The nonce value from the request.\\n * @param success - True if the sender transaction succeeded, false if reverted.\\n * @param actualGasCost - Actual amount paid (by account or paymaster) for this UserOperation.\\n * @param actualGasUsed - Total gas used by this UserOperation (including preVerification, creation,\\n * validation and execution).\\n */\\n event UserOperationEvent(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n address indexed paymaster,\\n uint256 nonce,\\n bool success,\\n uint256 actualGasCost,\\n uint256 actualGasUsed\\n );\\n\\n /**\\n * Account \\\"sender\\\" was deployed.\\n * @param userOpHash - The userOp that deployed this account. UserOperationEvent will follow.\\n * @param sender - The account that is deployed\\n * @param factory - The factory used to deploy this account (in the initCode)\\n * @param paymaster - The paymaster used by this UserOp\\n */\\n event AccountDeployed(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n address factory,\\n address paymaster\\n );\\n\\n /**\\n * An event emitted if the UserOperation \\\"callData\\\" reverted with non-zero length.\\n * @param userOpHash - The request unique identifier.\\n * @param sender - The sender of this request.\\n * @param nonce - The nonce used in the request.\\n * @param revertReason - The return bytes from the (reverted) call to \\\"callData\\\".\\n */\\n event UserOperationRevertReason(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n uint256 nonce,\\n bytes revertReason\\n );\\n\\n /**\\n * An event emitted if the UserOperation Paymaster's \\\"postOp\\\" call reverted with non-zero length.\\n * @param userOpHash - The request unique identifier.\\n * @param sender - The sender of this request.\\n * @param nonce - The nonce used in the request.\\n * @param revertReason - The return bytes from the (reverted) call to \\\"callData\\\".\\n */\\n event PostOpRevertReason(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n uint256 nonce,\\n bytes revertReason\\n );\\n\\n /**\\n * UserOp consumed more than prefund. The UserOperation is reverted, and no refund is made.\\n * @param userOpHash - The request unique identifier.\\n * @param sender - The sender of this request.\\n * @param nonce - The nonce used in the request.\\n */\\n event UserOperationPrefundTooLow(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n uint256 nonce\\n );\\n\\n /**\\n * An event emitted by handleOps(), before starting the execution loop.\\n * Any event emitted before this event, is part of the validation.\\n */\\n event BeforeExecution();\\n\\n /**\\n * Signature aggregator used by the following UserOperationEvents within this bundle.\\n * @param aggregator - The aggregator used for the following UserOperationEvents.\\n */\\n event SignatureAggregatorChanged(address indexed aggregator);\\n\\n /**\\n * A custom revert error of handleOps, to identify the offending op.\\n * Should be caught in off-chain handleOps simulation and not happen on-chain.\\n * Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts.\\n * NOTE: If simulateValidation passes successfully, there should be no reason for handleOps to fail on it.\\n * @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).\\n * @param reason - Revert reason. The string starts with a unique code \\\"AAmn\\\",\\n * where \\\"m\\\" is \\\"1\\\" for factory, \\\"2\\\" for account and \\\"3\\\" for paymaster issues,\\n * so a failure can be attributed to the correct entity.\\n */\\n error FailedOp(uint256 opIndex, string reason);\\n\\n /**\\n * A custom revert error of handleOps, to report a revert by account or paymaster.\\n * @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).\\n * @param reason - Revert reason. see FailedOp(uint256,string), above\\n * @param inner - data from inner cought revert reason\\n * @dev note that inner is truncated to 2048 bytes\\n */\\n error FailedOpWithRevert(uint256 opIndex, string reason, bytes inner);\\n\\n error PostOpReverted(bytes returnData);\\n\\n /**\\n * Error case when a signature aggregator fails to verify the aggregated signature it had created.\\n * @param aggregator The aggregator that failed to verify the signature\\n */\\n error SignatureValidationFailed(address aggregator);\\n\\n // Return value of getSenderAddress.\\n error SenderAddressResult(address sender);\\n\\n // UserOps handled, per aggregator.\\n struct UserOpsPerAggregator {\\n PackedUserOperation[] userOps;\\n // Aggregator address\\n IAggregator aggregator;\\n // Aggregated signature\\n bytes signature;\\n }\\n\\n /**\\n * Execute a batch of UserOperations.\\n * No signature aggregator is used.\\n * If any account requires an aggregator (that is, it returned an aggregator when\\n * performing simulateValidation), then handleAggregatedOps() must be used instead.\\n * @param ops - The operations to execute.\\n * @param beneficiary - The address to receive the fees.\\n */\\n function handleOps(\\n PackedUserOperation[] calldata ops,\\n address payable beneficiary\\n ) external;\\n\\n /**\\n * Execute a batch of UserOperation with Aggregators\\n * @param opsPerAggregator - The operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts).\\n * @param beneficiary - The address to receive the fees.\\n */\\n function handleAggregatedOps(\\n UserOpsPerAggregator[] calldata opsPerAggregator,\\n address payable beneficiary\\n ) external;\\n\\n /**\\n * Generate a request Id - unique identifier for this request.\\n * The request ID is a hash over the content of the userOp (except the signature), the entrypoint and the chainid.\\n * @param userOp - The user operation to generate the request ID for.\\n * @return hash the hash of this UserOperation\\n */\\n function getUserOpHash(\\n PackedUserOperation calldata userOp\\n ) external view returns (bytes32);\\n\\n /**\\n * Gas and return values during simulation.\\n * @param preOpGas - The gas used for validation (including preValidationGas)\\n * @param prefund - The required prefund for this operation\\n * @param accountValidationData - returned validationData from account.\\n * @param paymasterValidationData - return validationData from paymaster.\\n * @param paymasterContext - Returned by validatePaymasterUserOp (to be passed into postOp)\\n */\\n struct ReturnInfo {\\n uint256 preOpGas;\\n uint256 prefund;\\n uint256 accountValidationData;\\n uint256 paymasterValidationData;\\n bytes paymasterContext;\\n }\\n\\n /**\\n * Returned aggregated signature info:\\n * The aggregator returned by the account, and its current stake.\\n */\\n struct AggregatorStakeInfo {\\n address aggregator;\\n StakeInfo stakeInfo;\\n }\\n\\n /**\\n * Get counterfactual sender address.\\n * Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation.\\n * This method always revert, and returns the address in SenderAddressResult error\\n * @param initCode - The constructor code to be passed into the UserOperation.\\n */\\n function getSenderAddress(bytes memory initCode) external;\\n\\n error DelegateAndRevert(bool success, bytes ret);\\n\\n /**\\n * Helper method for dry-run testing.\\n * @dev calling this method, the EntryPoint will make a delegatecall to the given data, and report (via revert) the result.\\n * The method always revert, so is only useful off-chain for dry run calls, in cases where state-override to replace\\n * actual EntryPoint code is less convenient.\\n * @param target a target contract to make a delegatecall from entrypoint\\n * @param data data to pass to target in a delegatecall\\n */\\n function delegateAndRevert(address target, bytes calldata data) external;\\n}\\n\",\"keccak256\":\"0x1972a5fcb3a808b58c85af5741949ef6af11ab0debd3ae8c708171ae1ae0d0c4\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/INonceManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\ninterface INonceManager {\\n\\n /**\\n * Return the next nonce for this sender.\\n * Within a given key, the nonce values are sequenced (starting with zero, and incremented by one on each userop)\\n * But UserOp with different keys can come with arbitrary order.\\n *\\n * @param sender the account address\\n * @param key the high 192 bit of the nonce\\n * @return nonce a full nonce to pass for next UserOp with this sender.\\n */\\n function getNonce(address sender, uint192 key)\\n external view returns (uint256 nonce);\\n\\n /**\\n * Manually increment the nonce of the sender.\\n * This method is exposed just for completeness..\\n * Account does NOT need to call it, neither during validation, nor elsewhere,\\n * as the EntryPoint will update the nonce regardless.\\n * Possible use-case is call it with various keys to \\\"initialize\\\" their nonces to one, so that future\\n * UserOperations will not pay extra for the first transaction with a given key.\\n */\\n function incrementNonce(uint192 key) external;\\n}\\n\",\"keccak256\":\"0xd575af0f6ebbd5f0b2933307d44cd7b4e03a69f4b817a67db5409bd3c89aeecb\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IStakeManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity >=0.7.5;\\n\\n/**\\n * Manage deposits and stakes.\\n * Deposit is just a balance used to pay for UserOperations (either by a paymaster or an account).\\n * Stake is value locked for at least \\\"unstakeDelay\\\" by the staked entity.\\n */\\ninterface IStakeManager {\\n event Deposited(address indexed account, uint256 totalDeposit);\\n\\n event Withdrawn(\\n address indexed account,\\n address withdrawAddress,\\n uint256 amount\\n );\\n\\n // Emitted when stake or unstake delay are modified.\\n event StakeLocked(\\n address indexed account,\\n uint256 totalStaked,\\n uint256 unstakeDelaySec\\n );\\n\\n // Emitted once a stake is scheduled for withdrawal.\\n event StakeUnlocked(address indexed account, uint256 withdrawTime);\\n\\n event StakeWithdrawn(\\n address indexed account,\\n address withdrawAddress,\\n uint256 amount\\n );\\n\\n /**\\n * @param deposit - The entity's deposit.\\n * @param staked - True if this entity is staked.\\n * @param stake - Actual amount of ether staked for this entity.\\n * @param unstakeDelaySec - Minimum delay to withdraw the stake.\\n * @param withdrawTime - First block timestamp where 'withdrawStake' will be callable, or zero if already locked.\\n * @dev Sizes were chosen so that deposit fits into one cell (used during handleOp)\\n * and the rest fit into a 2nd cell (used during stake/unstake)\\n * - 112 bit allows for 10^15 eth\\n * - 48 bit for full timestamp\\n * - 32 bit allows 150 years for unstake delay\\n */\\n struct DepositInfo {\\n uint256 deposit;\\n bool staked;\\n uint112 stake;\\n uint32 unstakeDelaySec;\\n uint48 withdrawTime;\\n }\\n\\n // API struct used by getStakeInfo and simulateValidation.\\n struct StakeInfo {\\n uint256 stake;\\n uint256 unstakeDelaySec;\\n }\\n\\n /**\\n * Get deposit info.\\n * @param account - The account to query.\\n * @return info - Full deposit information of given account.\\n */\\n function getDepositInfo(\\n address account\\n ) external view returns (DepositInfo memory info);\\n\\n /**\\n * Get account balance.\\n * @param account - The account to query.\\n * @return - The deposit (for gas payment) of the account.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * Add to the deposit of the given account.\\n * @param account - The account to add to.\\n */\\n function depositTo(address account) external payable;\\n\\n /**\\n * Add to the account's stake - amount and delay\\n * any pending unstake is first cancelled.\\n * @param _unstakeDelaySec - The new lock duration before the deposit can be withdrawn.\\n */\\n function addStake(uint32 _unstakeDelaySec) external payable;\\n\\n /**\\n * Attempt to unlock the stake.\\n * The value can be withdrawn (using withdrawStake) after the unstake delay.\\n */\\n function unlockStake() external;\\n\\n /**\\n * Withdraw from the (unlocked) stake.\\n * Must first call unlockStake and wait for the unstakeDelay to pass.\\n * @param withdrawAddress - The address to send withdrawn value.\\n */\\n function withdrawStake(address payable withdrawAddress) external;\\n\\n /**\\n * Withdraw from the deposit.\\n * @param withdrawAddress - The address to send withdrawn value.\\n * @param withdrawAmount - The amount to withdraw.\\n */\\n function withdrawTo(\\n address payable withdrawAddress,\\n uint256 withdrawAmount\\n ) external;\\n}\\n\",\"keccak256\":\"0xbe5ca9e7f254d031687419e7b96ef48c9c63e9398bbe992dc72ffc6dc14e0a04\",\"license\":\"GPL-3.0-only\"},\"@account-abstraction/contracts/interfaces/PackedUserOperation.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\n/**\\n * User Operation struct\\n * @param sender - The sender account of this request.\\n * @param nonce - Unique value the sender uses to verify it is not a replay.\\n * @param initCode - If set, the account contract will be created by this constructor/\\n * @param callData - The method call to execute on this account.\\n * @param accountGasLimits - Packed gas limits for validateUserOp and gas limit passed to the callData method call.\\n * @param preVerificationGas - Gas not calculated by the handleOps method, but added to the gas paid.\\n * Covers batch overhead.\\n * @param gasFees - packed gas fields maxPriorityFeePerGas and maxFeePerGas - Same as EIP-1559 gas parameters.\\n * @param paymasterAndData - If set, this field holds the paymaster address, verification gas limit, postOp gas limit and paymaster-specific extra data\\n * The paymaster will pay for the transaction instead of the sender.\\n * @param signature - Sender-verified signature over the entire request, the EntryPoint address and the chain ID.\\n */\\nstruct PackedUserOperation {\\n address sender;\\n uint256 nonce;\\n bytes initCode;\\n bytes callData;\\n bytes32 accountGasLimits;\\n uint256 preVerificationGas;\\n bytes32 gasFees;\\n bytes paymasterAndData;\\n bytes signature;\\n}\\n\",\"keccak256\":\"0x1129b46381db68eddbc5cb49e50664667b66b03c480453858e7b25eabe444359\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/samples/callback/TokenCallbackHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable no-empty-blocks */\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\\\";\\n\\n/**\\n * Token callback handler.\\n * Handles supported tokens' callbacks, allowing account receiving these tokens.\\n */\\nabstract contract TokenCallbackHandler is IERC721Receiver, IERC1155Receiver {\\n\\n function onERC721Received(\\n address,\\n address,\\n uint256,\\n bytes calldata\\n ) external pure override returns (bytes4) {\\n return IERC721Receiver.onERC721Received.selector;\\n }\\n\\n function onERC1155Received(\\n address,\\n address,\\n uint256,\\n uint256,\\n bytes calldata\\n ) external pure override returns (bytes4) {\\n return IERC1155Receiver.onERC1155Received.selector;\\n }\\n\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] calldata,\\n uint256[] calldata,\\n bytes calldata\\n ) external pure override returns (bytes4) {\\n return IERC1155Receiver.onERC1155BatchReceived.selector;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\\n return\\n interfaceId == type(IERC721Receiver).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x7770340a57c4be2b718b6ac2b031722074c0d795e0f4e1a6740ca1aa3d85e9d7\",\"license\":\"GPL-3.0\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0xb25a4f11fa80c702bf5cd85adec90e6f6f507f32f4a8e6f5dbc31e8c10029486\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xc42facb5094f2f35f066a7155bda23545e39a3156faef3ddc00185544443ba7d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Proxy} from \\\"../Proxy.sol\\\";\\nimport {ERC1967Utils} from \\\"./ERC1967Utils.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an\\n * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * Requirements:\\n *\\n * - If `data` is empty, `msg.value` must be zero.\\n */\\n constructor(address implementation, bytes memory _data) payable {\\n ERC1967Utils.upgradeToAndCall(implementation, _data);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return ERC1967Utils.getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x0a8a5b994d4c4da9f61d128945cc8c9e60dcbc72bf532f72ae42a48ea90eed9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol)\\n\\npragma solidity ^0.8.21;\\n\\nimport {IBeacon} from \\\"../beacon/IBeacon.sol\\\";\\nimport {IERC1967} from \\\"../../interfaces/IERC1967.sol\\\";\\nimport {Address} from \\\"../../utils/Address.sol\\\";\\nimport {StorageSlot} from \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This library provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\\n */\\nlibrary ERC1967Utils {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev The `implementation` of the proxy is invalid.\\n */\\n error ERC1967InvalidImplementation(address implementation);\\n\\n /**\\n * @dev The `admin` of the proxy is invalid.\\n */\\n error ERC1967InvalidAdmin(address admin);\\n\\n /**\\n * @dev The `beacon` of the proxy is invalid.\\n */\\n error ERC1967InvalidBeacon(address beacon);\\n\\n /**\\n * @dev An upgrade function sees `msg.value > 0` that may be lost.\\n */\\n error ERC1967NonPayable();\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the ERC-1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n if (newImplementation.code.length == 0) {\\n revert ERC1967InvalidImplementation(newImplementation);\\n }\\n StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Performs implementation upgrade with additional setup call if data is nonempty.\\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\\n * to avoid stuck value in the contract.\\n *\\n * Emits an {IERC1967-Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) internal {\\n _setImplementation(newImplementation);\\n emit IERC1967.Upgraded(newImplementation);\\n\\n if (data.length > 0) {\\n Address.functionDelegateCall(newImplementation, data);\\n } else {\\n _checkNonPayable();\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the ERC-1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n if (newAdmin == address(0)) {\\n revert ERC1967InvalidAdmin(address(0));\\n }\\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {IERC1967-AdminChanged} event.\\n */\\n function changeAdmin(address newAdmin) internal {\\n emit IERC1967.AdminChanged(getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.beacon\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the ERC-1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n if (newBeacon.code.length == 0) {\\n revert ERC1967InvalidBeacon(newBeacon);\\n }\\n\\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\\n\\n address beaconImplementation = IBeacon(newBeacon).implementation();\\n if (beaconImplementation.code.length == 0) {\\n revert ERC1967InvalidImplementation(beaconImplementation);\\n }\\n }\\n\\n /**\\n * @dev Change the beacon and trigger a setup call if data is nonempty.\\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\\n * to avoid stuck value in the contract.\\n *\\n * Emits an {IERC1967-BeaconUpgraded} event.\\n *\\n * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\\n * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\\n * efficiency.\\n */\\n function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\\n _setBeacon(newBeacon);\\n emit IERC1967.BeaconUpgraded(newBeacon);\\n\\n if (data.length > 0) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n } else {\\n _checkNonPayable();\\n }\\n }\\n\\n /**\\n * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\\n * if an upgrade doesn't perform an initialization call.\\n */\\n function _checkNonPayable() private {\\n if (msg.value > 0) {\\n revert ERC1967NonPayable();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x911c3346ee26afe188f3b9dc267ef62a7ccf940aba1afa963e3922f0ca3d8a06\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback\\n * function and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n}\\n\",\"keccak256\":\"0xc3f2ec76a3de8ed7a7007c46166f5550c72c7709e3fc7e8bb3111a7191cdedbd\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {UpgradeableBeacon} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc59a78b07b44b2cf2e8ab4175fca91e8eca1eee2df7357b8d2a8833e5ea1f64c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error InvalidInitialization();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\\n * production.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n // Cache values to avoid duplicated sloads\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n\\n // Allowed calls:\\n // - initialSetup: the contract is not in the initializing state and no previous version was\\n // initialized\\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\\n // current contract is just being deployed\\n bool initialSetup = initialized == 0 && isTopLevelCall;\\n bool construction = initialized == 1 && address(this).code.length == 0;\\n\\n if (!initialSetup && !construction) {\\n revert InvalidInitialization();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert InvalidInitialization();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert InvalidInitialization();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC1822Proxiable} from \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport {ERC1967Utils} from \\\"../ERC1967/ERC1967Utils.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSUpgradeable is IERC1822Proxiable {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\\n * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\\n * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\\n * If the getter returns `\\\"5.0.0\\\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\\n * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\\n * during an upgrade.\\n */\\n string public constant UPGRADE_INTERFACE_VERSION = \\\"5.0.0\\\";\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n _checkProxy();\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n _checkNotDelegated();\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual notDelegated returns (bytes32) {\\n return ERC1967Utils.IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n *\\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data);\\n }\\n\\n /**\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\\n * See {_onlyProxy}.\\n */\\n function _checkProxy() internal view virtual {\\n if (\\n address(this) == __self || // Must be called through delegatecall\\n ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\\n ) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n }\\n\\n /**\\n * @dev Reverts if the execution is performed via delegatecall.\\n * See {notDelegated}.\\n */\\n function _checkNotDelegated() internal view virtual {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\\n *\\n * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\\n * is expected to be the implementation slot in ERC-1967.\\n *\\n * Emits an {IERC1967-Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n ERC1967Utils.upgradeToAndCall(newImplementation, data);\\n } catch {\\n // The implementation is not UUPS\\n revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb3f8fb5dc1c423373e346c4eccd6dc74ed858d70d58fb35cb721d1c56ca19bdf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Create2.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev There's no code to deploy.\\n */\\n error Create2EmptyBytecode();\\n\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n if (bytecode.length == 0) {\\n revert Create2EmptyBytecode();\\n }\\n assembly (\\\"memory-safe\\\") {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n // if no address was created, and returndata is not empty, bubble revert\\n if and(iszero(addr), not(iszero(returndatasize()))) {\\n let p := mload(0x40)\\n returndatacopy(p, 0, returndatasize())\\n revert(p, returndatasize())\\n }\\n }\\n if (addr == address(0)) {\\n revert Errors.FailedDeployment();\\n }\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40) // Get free memory pointer\\n\\n // | | \\u2193 ptr ... \\u2193 ptr + 0x0B (start) ... \\u2193 ptr + 0x20 ... \\u2193 ptr + 0x40 ... |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\\n // | salt | BBBBBBBBBBBBB...BB |\\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\\n // | 0xFF | FF |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\\n // | keccak(start, 85) | \\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191 |\\n\\n mstore(add(ptr, 0x40), bytecodeHash)\\n mstore(add(ptr, 0x20), salt)\\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\\n mstore8(start, 0xff)\\n addr := and(keccak256(start, 85), 0xffffffffffffffffffffffffffffffffffffffff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbb7e8401583d26268ea9103013bcdcd90866a7718bd91105ebd21c9bf11f4f06\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value)));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n uint256 localValue = value;\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\\n * representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS\\n }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n assembly (\\\"memory-safe\\\") {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS, s);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"contracts/PublicKeyRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity ^0.8.27;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract PublicKeyRegistry is Ownable(msg.sender) {\\n /// providerId => publicKeyHash => isValid\\n mapping(bytes32 => mapping(bytes32 => bool)) public isPublicKeyHashValid;\\n\\n function setPublicKeyValid(\\n bytes32 providerId,\\n bytes32 publicKeyHash,\\n bool valid\\n ) external onlyOwner {\\n isPublicKeyHashValid[providerId][publicKeyHash] = valid;\\n }\\n\\n struct PublicKeyValidity {\\n bytes32 providerId;\\n bytes32 publicKeyHash;\\n bool valid;\\n }\\n\\n function setPublicKeysValid(\\n PublicKeyValidity[] calldata validity\\n ) external onlyOwner {\\n for (uint256 i = 0; i < validity.length; i++) {\\n PublicKeyValidity calldata v = validity[i];\\n isPublicKeyHashValid[v.providerId][v.publicKeyHash] = v.valid;\\n }\\n }\\n\\n function checkPublicKey(\\n bytes32 providerId,\\n bytes32 publicKeyHash\\n ) external view returns (bool) {\\n return isPublicKeyHashValid[providerId][publicKeyHash];\\n }\\n}\\n\",\"keccak256\":\"0x49e25ad2c49b24f9fa828b12fa5bc1df386dfc1e6311cc680efb7366292ec0c9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/SimpleAccount.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable avoid-low-level-calls */\\n/* solhint-disable no-inline-assembly */\\n/* solhint-disable reason-string */\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@account-abstraction/contracts/core/BaseAccount.sol\\\";\\nimport \\\"@account-abstraction/contracts/core/Helpers.sol\\\";\\nimport \\\"@account-abstraction/contracts/samples/callback/TokenCallbackHandler.sol\\\";\\n\\nimport {PublicKeyRegistry} from \\\"./PublicKeyRegistry.sol\\\";\\nimport {ZkLogin} from \\\"./ZkLogin.sol\\\";\\n\\n// Note: keep in sync with JS\\n// How long owner session is valid for\\nuint96 constant OWNER_EXPIRATION_TIME = 24 hours;\\n\\n// Note: keep in sync with JS\\n// How long a jwt is valid for\\nuint256 constant JWT_EXPIRATION_TIME = 1 hours;\\n\\n/**\\n * minimal account.\\n * this is sample minimal account.\\n * has execute, eth handling methods\\n * has a single signer that can send requests through the entryPoint.\\n */\\ncontract SimpleAccount is\\n BaseAccount,\\n TokenCallbackHandler,\\n UUPSUpgradeable,\\n Initializable\\n{\\n IEntryPoint private immutable _entryPoint;\\n\\n struct Owner {\\n address owner;\\n uint96 expirationTimestamp;\\n }\\n Owner public ownerInfo;\\n\\n ZkLogin.AccountData public accountData;\\n\\n constructor(IEntryPoint anEntryPoint) {\\n _entryPoint = anEntryPoint;\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev The _entryPoint member is immutable, to reduce gas consumption. To upgrade EntryPoint,\\n * a new implementation of SimpleAccount must be deployed with the new EntryPoint address, then upgrading\\n * the implementation by calling `upgradeTo()`\\n */\\n function initialize(\\n ZkLogin.AccountData calldata accountData_\\n ) public virtual initializer {\\n accountData = accountData_;\\n }\\n\\n /// implement template method of BaseAccount\\n function _validateSignature(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash\\n ) internal virtual override returns (uint256 validationData) {\\n bytes32 hash = MessageHashUtils.toEthSignedMessageHash(userOpHash);\\n if (currentOwner() != ECDSA.recover(hash, userOp.signature))\\n return SIG_VALIDATION_FAILED;\\n return SIG_VALIDATION_SUCCESS;\\n }\\n\\n function validateUserOp(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash,\\n uint256 missingAccountFunds\\n ) external virtual override returns (uint256 validationData) {\\n if (bytes4(userOp.callData) == this.setOwner.selector) {\\n // because it is a non-restricted function\\n return SIG_VALIDATION_SUCCESS;\\n }\\n\\n // copy-pasted from BaseAccount\\n _requireFromEntryPoint();\\n validationData = _validateSignature(userOp, userOpHash);\\n _validateNonce(userOp.nonce);\\n _payPrefund(missingAccountFunds);\\n }\\n\\n function currentOwner() public view returns (address) {\\n Owner memory ownerInfo_ = ownerInfo;\\n if (block.timestamp > ownerInfo_.expirationTimestamp) {\\n return address(0);\\n }\\n return ownerInfo_.owner;\\n }\\n\\n function setOwner(\\n ZkLogin.VerificationData calldata verificationData\\n ) public {\\n require(\\n verificationData.jwtIat + JWT_EXPIRATION_TIME >= block.timestamp,\\n \\\"JwtAccount: expired proof\\\"\\n );\\n bool result = ZkLogin.verifyProof(accountData, verificationData);\\n require(result, \\\"JwtAccount: invalid proof\\\");\\n\\n ownerInfo = Owner({\\n owner: address(uint160(uint256(verificationData.jwtNonce))),\\n expirationTimestamp: uint96(block.timestamp) + OWNER_EXPIRATION_TIME\\n });\\n }\\n\\n function _call(address target, uint256 value, bytes memory data) internal {\\n (bool success, bytes memory result) = target.call{value: value}(data);\\n if (!success) {\\n assembly {\\n revert(add(result, 32), mload(result))\\n }\\n }\\n }\\n\\n /**\\n * execute a transaction (called directly from owner, or by entryPoint)\\n * @param dest destination address to call\\n * @param value the value to pass in this call\\n * @param func the calldata to pass in this call\\n */\\n function execute(\\n address dest,\\n uint256 value,\\n bytes calldata func\\n ) external {\\n _requireFromEntryPointOrOwner();\\n _call(dest, value, func);\\n }\\n\\n /// @notice Represents a call to make.\\n struct Call {\\n /// @dev The address to call.\\n address target;\\n /// @dev The value to send when making the call.\\n uint256 value;\\n /// @dev The data of the call.\\n bytes data;\\n }\\n\\n /**\\n * execute a sequence of transactions\\n */\\n function executeBatch(Call[] calldata calls) external {\\n _requireFromEntryPointOrOwner();\\n for (uint256 i; i < calls.length; i++) {\\n _call(calls[i].target, calls[i].value, calls[i].data);\\n }\\n }\\n\\n /**\\n * check current account deposit in the entryPoint\\n */\\n function getDeposit() public view returns (uint256) {\\n return entryPoint().balanceOf(address(this));\\n }\\n\\n /**\\n * deposit more funds for this account in the entryPoint\\n */\\n function addDeposit() public payable {\\n entryPoint().depositTo{value: msg.value}(address(this));\\n }\\n\\n /**\\n * withdraw value from the account's deposit\\n * @param withdrawAddress target to send to\\n * @param amount to withdraw\\n */\\n function withdrawDepositTo(\\n address payable withdrawAddress,\\n uint256 amount\\n ) public onlyOwner {\\n entryPoint().withdrawTo(withdrawAddress, amount);\\n }\\n\\n // Require the function call went through EntryPoint or owner\\n function _requireFromEntryPointOrOwner() internal view {\\n require(\\n msg.sender == address(entryPoint()) || msg.sender == currentOwner(),\\n \\\"account: not Owner or EntryPoint\\\"\\n );\\n }\\n\\n /// @inheritdoc BaseAccount\\n function entryPoint() public view virtual override returns (IEntryPoint) {\\n return _entryPoint;\\n }\\n\\n modifier onlyOwner() {\\n _onlyOwner();\\n _;\\n }\\n\\n function _onlyOwner() internal view {\\n //directly from EOA owner, or through the account itself (which gets redirected through execute())\\n require(\\n msg.sender == currentOwner() || msg.sender == address(this),\\n \\\"only owner\\\"\\n );\\n }\\n\\n // solhint-disable-next-line no-empty-blocks\\n receive() external payable {}\\n\\n function _authorizeUpgrade(\\n address newImplementation\\n ) internal view override {\\n (newImplementation);\\n _onlyOwner();\\n }\\n}\\n\",\"keccak256\":\"0xe7c9a068a3cfb7575d5d9d9e2bb30002c7705c98de47c092d933d15d7db23baf\",\"license\":\"GPL-3.0\"},\"contracts/SimpleAccountFactory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\n\\nimport {SimpleAccount, IEntryPoint} from \\\"./SimpleAccount.sol\\\";\\nimport {PublicKeyRegistry} from \\\"./PublicKeyRegistry.sol\\\";\\nimport {ZkLogin} from \\\"./ZkLogin.sol\\\";\\n\\n/**\\n * A sample factory contract for SimpleAccount\\n * A UserOperations \\\"initCode\\\" holds the address of the factory, and a method call (to createAccount, in this sample factory).\\n * The factory's createAccount returns the target account address even if it is already installed.\\n * This way, the entryPoint.getSenderAddress() can be called either before or after the account is created.\\n */\\ncontract SimpleAccountFactory {\\n SimpleAccount public immutable accountImplementation;\\n\\n constructor(IEntryPoint _entryPoint) {\\n accountImplementation = new SimpleAccount(_entryPoint);\\n }\\n\\n /**\\n * create an account, and return its address.\\n * returns the address even if the account is already deployed.\\n * Note that during UserOperation execution, this method is called only if the account is not deployed.\\n * This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation\\n */\\n function createAccount(\\n ZkLogin.AccountData calldata params\\n ) public returns (SimpleAccount ret) {\\n // TODO: create2 address should depend only on accountId and jwt.aud (and maybe \\\"jwt.iss\\\"?)\\n ret = SimpleAccount(\\n payable(\\n new ERC1967Proxy{salt: bytes32(0)}(\\n address(accountImplementation),\\n abi.encodeCall(SimpleAccount.initialize, params)\\n )\\n )\\n );\\n }\\n\\n /**\\n * calculate the counterfactual address of this account as it would be returned by createAccount()\\n */\\n function getAccountAddress(\\n ZkLogin.AccountData calldata params\\n ) public view returns (address) {\\n return\\n Create2.computeAddress(\\n bytes32(0),\\n keccak256(\\n abi.encodePacked(\\n type(ERC1967Proxy).creationCode,\\n abi.encode(\\n address(accountImplementation),\\n abi.encodeCall(SimpleAccount.initialize, (params))\\n )\\n )\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xb9f88ff48f2bb143e26e072da63a0ee20ba38e788430ba16e4a07374f7366b76\",\"license\":\"GPL-3.0\"},\"contracts/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity ^0.8.27;\\n\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\n\\n function toHexStringWithoutPrefix(\\n uint256 value,\\n uint256 length\\n ) internal pure returns (string memory) {\\n uint256 localValue = value;\\n bytes memory buffer = new bytes(2 * length);\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i - 2] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\n return string(buffer);\\n }\\n\\n function toHexStringWithoutPrefix(\\n bytes32 value\\n ) internal pure returns (string memory) {\\n return toHexStringWithoutPrefix(uint256(value), 32);\\n }\\n}\\n\",\"keccak256\":\"0x71f8f11a2e7a84881a5ceb1cc52313d3e4e09b2e7ff6a09a0afb6dd7bc05651c\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/ZkLogin.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity ^0.8.27;\\n\\nimport {UltraVerifier} from \\\"../noir/target/jwt_account.sol\\\";\\nimport {Strings} from \\\"./Strings.sol\\\";\\nimport {PublicKeyRegistry} from \\\"./PublicKeyRegistry.sol\\\";\\n\\nlibrary ZkLogin {\\n struct AccountData {\\n bytes32 accountId;\\n bytes32 authProviderId;\\n PublicKeyRegistry publicKeyRegistry;\\n UltraVerifier proofVerifier;\\n }\\n\\n struct VerificationData {\\n bytes proof;\\n uint256 jwtIat;\\n bytes32 jwtNonce;\\n bytes32 publicKeyHash;\\n }\\n\\n function verifyProof(\\n AccountData memory accountData,\\n VerificationData memory verificationData\\n ) internal view returns (bool) {\\n require(\\n accountData.publicKeyRegistry.checkPublicKey(\\n accountData.authProviderId,\\n verificationData.publicKeyHash\\n ),\\n \\\"public key hash mismatch\\\"\\n );\\n\\n bytes memory jwtNonce = bytes(\\n Strings.toHexStringWithoutPrefix(verificationData.jwtNonce)\\n );\\n\\n uint256 staticInputLength = 3;\\n bytes32[] memory publicInputs = new bytes32[](\\n staticInputLength + jwtNonce.length\\n );\\n uint256 j = 0;\\n publicInputs[j++] = accountData.accountId;\\n publicInputs[j++] = bytes32(verificationData.jwtIat);\\n publicInputs[j++] = verificationData.publicKeyHash;\\n\\n for (uint256 i = 0; i < jwtNonce.length; i++) {\\n publicInputs[j++] = bytes32(uint256(uint8(jwtNonce[i])));\\n }\\n\\n return\\n accountData.proofVerifier.verify(\\n verificationData.proof,\\n publicInputs\\n );\\n }\\n}\\n\",\"keccak256\":\"0x466ab1f4d8c9da572f3515e3c3ebd1ec0ae4da84e12d40dc97dd685c31d441ed\",\"license\":\"SEE LICENSE IN LICENSE\"},\"noir/target/jwt_account.sol\":{\"content\":\"// Verification Key Hash: df17b68894fbe76ada8e2859abb6925eb52b99f2516db87bc9720ed3f22c9625\\n// SPDX-License-Identifier: Apache-2.0\\n// Copyright 2022 Aztec\\npragma solidity >=0.8.4;\\n\\nlibrary UltraVerificationKey {\\n function verificationKeyHash() internal pure returns(bytes32) {\\n return 0xdf17b68894fbe76ada8e2859abb6925eb52b99f2516db87bc9720ed3f22c9625;\\n }\\n\\n function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure {\\n assembly {\\n mstore(add(_vk, 0x00), 0x0000000000000000000000000000000000000000000000000000000000040000) // vk.circuit_size\\n mstore(add(_vk, 0x20), 0x0000000000000000000000000000000000000000000000000000000000000043) // vk.num_inputs\\n mstore(add(_vk, 0x40), 0x19ddbcaf3a8d46c15c0176fbb5b95e4dc57088ff13f4d1bd84c6bfa57dcdc0e0) // vk.work_root\\n mstore(add(_vk, 0x60), 0x30644259cd94e7dd5045d7a27013b7fcd21c9e3b7fa75222e7bda49b729b0401) // vk.domain_inverse\\n mstore(add(_vk, 0x80), 0x1f71d28f11460f73331294dcf27294a19ed4b299e9017ae496055943f52e24e2) // vk.Q1.x\\n mstore(add(_vk, 0xa0), 0x271a3a71a32f091c6798366f7973de1d977acfaf7724ff5058e7cba7cdd23b80) // vk.Q1.y\\n mstore(add(_vk, 0xc0), 0x2b1cb88996c8731ebf20516498954b9a032de3b05df44d5e7d26e6363f3d60e1) // vk.Q2.x\\n mstore(add(_vk, 0xe0), 0x196fadb6d06f205cc5ebae7284263b042d5b9fa18199256d3cc7781e3711af5d) // vk.Q2.y\\n mstore(add(_vk, 0x100), 0x08c5d310e66efae284aa2e844dec1675291c7991f45b4cdaa46ba9b8e537b9be) // vk.Q3.x\\n mstore(add(_vk, 0x120), 0x19d75133597f5a7faa14851b95187f35ef8f1fa1f414d3f4089cc07f1b9865e4) // vk.Q3.y\\n mstore(add(_vk, 0x140), 0x1b8337f6394b77c6fd4fb9f6d6a92a6edc860e19c3653088a95edc825af4b540) // vk.Q4.x\\n mstore(add(_vk, 0x160), 0x0780e2515f54a5f9c172e47e47021b475bc28d46a5507d71ca963ea8bcf76082) // vk.Q4.y\\n mstore(add(_vk, 0x180), 0x2e0f0594e85394a51b61896fe2c840722a2fb8b47b0085fa8402689a9e69db78) // vk.Q_M.x\\n mstore(add(_vk, 0x1a0), 0x12d1e049b46895986669c27c85bc03c732e1f8588e8a7692f89574875472b207) // vk.Q_M.y\\n mstore(add(_vk, 0x1c0), 0x2386abedd596e6ae42de8b18c2c2482a0f132fed2010b5701c7e5e84e6abf202) // vk.Q_C.x\\n mstore(add(_vk, 0x1e0), 0x25844948d313c3863f20e125e45f6812f96c4474a9a391a79b70da7b79ff14f9) // vk.Q_C.y\\n mstore(add(_vk, 0x200), 0x281abbca08b2d727b5f127242dc71d78d7d133ce160cfeb8f11438f69f8ae5ef) // vk.Q_ARITHMETIC.x\\n mstore(add(_vk, 0x220), 0x151febc070ee5a29f29e66c7dfdc46d31d53781b12a5092e7fcc32cb8e5f1ef9) // vk.Q_ARITHMETIC.y\\n mstore(add(_vk, 0x240), 0x1107a754c3f11021248c43d10abd2ed46eafd9e293ee620b50cdb47e65123bc7) // vk.QSORT.x\\n mstore(add(_vk, 0x260), 0x150544048502e4a6252dc819526c72cf6e605c841af7b06028e7f722819893a7) // vk.QSORT.y\\n mstore(add(_vk, 0x280), 0x22f2a3213af13776e6bd38362a5885cbf923d5630eda38ba032a42faeb1ea61c) // vk.Q_ELLIPTIC.x\\n mstore(add(_vk, 0x2a0), 0x177d8d1ed4c4b9e2c3f232b25de8638139e795bd40689a9765750ebaca55f48f) // vk.Q_ELLIPTIC.y\\n mstore(add(_vk, 0x2c0), 0x0383b7f12114cc47c75eb683abb079fdb0cddcade14107819bb917209c0ae05a) // vk.Q_AUX.x\\n mstore(add(_vk, 0x2e0), 0x0ac0be98b2a66afb7df02cf9bcb702ab54e4d48fb08eef1f8c60a957603617cd) // vk.Q_AUX.y\\n mstore(add(_vk, 0x300), 0x199abd2d188bed224ba145f82d16e61939a31b6fb98fd6620e1b0242cf78bb0f) // vk.SIGMA1.x\\n mstore(add(_vk, 0x320), 0x1199f428a1af935ac6e0fd709b7fd8393bdce95e95f017257583153a99befb44) // vk.SIGMA1.y\\n mstore(add(_vk, 0x340), 0x1fb4c449e6bd67bc3dd0ec09e740bd5895b1952f2c42a54c0eb8d59ffa4f81e4) // vk.SIGMA2.x\\n mstore(add(_vk, 0x360), 0x15914e6eac131c6c3e51703646e5524a0be256a25f0a29ac12aca19352c9bff6) // vk.SIGMA2.y\\n mstore(add(_vk, 0x380), 0x2ea86576148d8d46e4b782c77af341f15b7d0d68f661b3445f6476dd54a7a558) // vk.SIGMA3.x\\n mstore(add(_vk, 0x3a0), 0x1e1bee942b8d63fb9e4a324d07f538d69a0b9d895a0e765e8116df0dd41350b3) // vk.SIGMA3.y\\n mstore(add(_vk, 0x3c0), 0x1a97a02b48f748c9fe2dcc9c3f829b2ea194f120c1110a43080112108eacad9e) // vk.SIGMA4.x\\n mstore(add(_vk, 0x3e0), 0x1dcab1530e972eb87903764308228f9c6eb1e0a8ece757616146eb9ac92f41a0) // vk.SIGMA4.y\\n mstore(add(_vk, 0x400), 0x12037992a0868b71fd31e8afdd2eadb65703eb9b066f46619795addc76c4c040) // vk.TABLE1.x\\n mstore(add(_vk, 0x420), 0x03087c87f8e680e93787d0b1ee1e7b03a361953026880f136896be768c398a52) // vk.TABLE1.y\\n mstore(add(_vk, 0x440), 0x20333b8a625e44316eb415594db2fb1418360858b9bbd871eb602d1e2d99aec3) // vk.TABLE2.x\\n mstore(add(_vk, 0x460), 0x071cff58e911f0bfbb01a49556356929c0d32d3a343fb91c62728b5f40ef9c2e) // vk.TABLE2.y\\n mstore(add(_vk, 0x480), 0x05ea76ef86cb4a6516241f0ffd1cb4a3d08911ed1785b2c2e5d21d03160af911) // vk.TABLE3.x\\n mstore(add(_vk, 0x4a0), 0x04bf914031bd405440af705425e95109b8ccb07be5f521baf78522a47f808aef) // vk.TABLE3.y\\n mstore(add(_vk, 0x4c0), 0x17841405ffd5b7391dfc4c67df8b83b829c04c6c39fa304c63ba85efc356cb6b) // vk.TABLE4.x\\n mstore(add(_vk, 0x4e0), 0x071662508f56a08c39f23e3b574939b610830931daaf5f8c7da09d8341423e72) // vk.TABLE4.y\\n mstore(add(_vk, 0x500), 0x2cd0adb4efab7c1f2f3ce467113f6b5a60ab824b86852c995d83e87af264bd71) // vk.TABLE_TYPE.x\\n mstore(add(_vk, 0x520), 0x0c6a58624d7220202551ec32fe8abdd14f9830dc08578941185a66282cb04948) // vk.TABLE_TYPE.y\\n mstore(add(_vk, 0x540), 0x13f7aa6c469715e6cd1f38bf20c9b09078403df8217f9d30df97aae41d460f40) // vk.ID1.x\\n mstore(add(_vk, 0x560), 0x02944c0148d257c53e52d2ea61b6fcfedf6dc6861d4833893f5b2f367e68232f) // vk.ID1.y\\n mstore(add(_vk, 0x580), 0x0737ea2401dff83ecc5d6258aec1533b305e85a418c2a8c2fbec7bf6fbc39599) // vk.ID2.x\\n mstore(add(_vk, 0x5a0), 0x108fb619aec96784857cd68447c8455790602ef51e7e6e4c7cdc416831a9ab50) // vk.ID2.y\\n mstore(add(_vk, 0x5c0), 0x1064d92338c133f3c77d13a7d4d688f94216dca3143f8ff96aa5b9530295cc97) // vk.ID3.x\\n mstore(add(_vk, 0x5e0), 0x2336336f949cb51eab3edeb98bbeeb7aecd353fda918c1ee5aea9d01f1e2b446) // vk.ID3.y\\n mstore(add(_vk, 0x600), 0x1beb44efe9150760b8b668dd41a5229e21258845fb446004f5b5501ba4a6495c) // vk.ID4.x\\n mstore(add(_vk, 0x620), 0x1c7187e828b8c1ef699c55a031ca21baeea080a8f70a7e41b41ea35eff4ffeb0) // vk.ID4.y\\n mstore(add(_vk, 0x640), 0x00) // vk.contains_pairing_point_accumulator\\n mstore(add(_vk, 0x660), 0) // vk.pairing_point_accumulator_public_input_indices\\n mstore(add(_vk, 0x680), 0x260e01b251f6f1c7e7ff4e580791dee8ea51d87a358e038b4efe30fac09383c1) // vk.g2_x.X.c1 \\n mstore(add(_vk, 0x6a0), 0x0118c4d5b837bcc2bc89b5b398b5974e9f5944073b32078b7e231fec938883b0) // vk.g2_x.X.c0 \\n mstore(add(_vk, 0x6c0), 0x04fc6369f7110fe3d25156c1bb9a72859cf2a04641f99ba4ee413c80da6a5fe4) // vk.g2_x.Y.c1 \\n mstore(add(_vk, 0x6e0), 0x22febda3c0c0632a56475b4214e5615e11e6dd3f96e6cea2854a87d4dacc5e55) // vk.g2_x.Y.c0 \\n mstore(_omegaInverseLoc, 0x036853f083780e87f8d7c71d111119c57dbe118c22d5ad707a82317466c5174c) // vk.work_root_inverse\\n }\\n }\\n}\\n\\n/**\\n * @title Ultra Plonk proof verification contract\\n * @dev Top level Plonk proof verification contract, which allows Plonk proof to be verified\\n */\\nabstract contract BaseUltraVerifier {\\n // VERIFICATION KEY MEMORY LOCATIONS\\n uint256 internal constant N_LOC = 0x380;\\n uint256 internal constant NUM_INPUTS_LOC = 0x3a0;\\n uint256 internal constant OMEGA_LOC = 0x3c0;\\n uint256 internal constant DOMAIN_INVERSE_LOC = 0x3e0;\\n uint256 internal constant Q1_X_LOC = 0x400;\\n uint256 internal constant Q1_Y_LOC = 0x420;\\n uint256 internal constant Q2_X_LOC = 0x440;\\n uint256 internal constant Q2_Y_LOC = 0x460;\\n uint256 internal constant Q3_X_LOC = 0x480;\\n uint256 internal constant Q3_Y_LOC = 0x4a0;\\n uint256 internal constant Q4_X_LOC = 0x4c0;\\n uint256 internal constant Q4_Y_LOC = 0x4e0;\\n uint256 internal constant QM_X_LOC = 0x500;\\n uint256 internal constant QM_Y_LOC = 0x520;\\n uint256 internal constant QC_X_LOC = 0x540;\\n uint256 internal constant QC_Y_LOC = 0x560;\\n uint256 internal constant QARITH_X_LOC = 0x580;\\n uint256 internal constant QARITH_Y_LOC = 0x5a0;\\n uint256 internal constant QSORT_X_LOC = 0x5c0;\\n uint256 internal constant QSORT_Y_LOC = 0x5e0;\\n uint256 internal constant QELLIPTIC_X_LOC = 0x600;\\n uint256 internal constant QELLIPTIC_Y_LOC = 0x620;\\n uint256 internal constant QAUX_X_LOC = 0x640;\\n uint256 internal constant QAUX_Y_LOC = 0x660;\\n uint256 internal constant SIGMA1_X_LOC = 0x680;\\n uint256 internal constant SIGMA1_Y_LOC = 0x6a0;\\n uint256 internal constant SIGMA2_X_LOC = 0x6c0;\\n uint256 internal constant SIGMA2_Y_LOC = 0x6e0;\\n uint256 internal constant SIGMA3_X_LOC = 0x700;\\n uint256 internal constant SIGMA3_Y_LOC = 0x720;\\n uint256 internal constant SIGMA4_X_LOC = 0x740;\\n uint256 internal constant SIGMA4_Y_LOC = 0x760;\\n uint256 internal constant TABLE1_X_LOC = 0x780;\\n uint256 internal constant TABLE1_Y_LOC = 0x7a0;\\n uint256 internal constant TABLE2_X_LOC = 0x7c0;\\n uint256 internal constant TABLE2_Y_LOC = 0x7e0;\\n uint256 internal constant TABLE3_X_LOC = 0x800;\\n uint256 internal constant TABLE3_Y_LOC = 0x820;\\n uint256 internal constant TABLE4_X_LOC = 0x840;\\n uint256 internal constant TABLE4_Y_LOC = 0x860;\\n uint256 internal constant TABLE_TYPE_X_LOC = 0x880;\\n uint256 internal constant TABLE_TYPE_Y_LOC = 0x8a0;\\n uint256 internal constant ID1_X_LOC = 0x8c0;\\n uint256 internal constant ID1_Y_LOC = 0x8e0;\\n uint256 internal constant ID2_X_LOC = 0x900;\\n uint256 internal constant ID2_Y_LOC = 0x920;\\n uint256 internal constant ID3_X_LOC = 0x940;\\n uint256 internal constant ID3_Y_LOC = 0x960;\\n uint256 internal constant ID4_X_LOC = 0x980;\\n uint256 internal constant ID4_Y_LOC = 0x9a0;\\n uint256 internal constant CONTAINS_RECURSIVE_PROOF_LOC = 0x9c0;\\n uint256 internal constant RECURSIVE_PROOF_PUBLIC_INPUT_INDICES_LOC = 0x9e0;\\n uint256 internal constant G2X_X0_LOC = 0xa00;\\n uint256 internal constant G2X_X1_LOC = 0xa20;\\n uint256 internal constant G2X_Y0_LOC = 0xa40;\\n uint256 internal constant G2X_Y1_LOC = 0xa60;\\n\\n // ### PROOF DATA MEMORY LOCATIONS\\n uint256 internal constant W1_X_LOC = 0x1200;\\n uint256 internal constant W1_Y_LOC = 0x1220;\\n uint256 internal constant W2_X_LOC = 0x1240;\\n uint256 internal constant W2_Y_LOC = 0x1260;\\n uint256 internal constant W3_X_LOC = 0x1280;\\n uint256 internal constant W3_Y_LOC = 0x12a0;\\n uint256 internal constant W4_X_LOC = 0x12c0;\\n uint256 internal constant W4_Y_LOC = 0x12e0;\\n uint256 internal constant S_X_LOC = 0x1300;\\n uint256 internal constant S_Y_LOC = 0x1320;\\n uint256 internal constant Z_X_LOC = 0x1340;\\n uint256 internal constant Z_Y_LOC = 0x1360;\\n uint256 internal constant Z_LOOKUP_X_LOC = 0x1380;\\n uint256 internal constant Z_LOOKUP_Y_LOC = 0x13a0;\\n uint256 internal constant T1_X_LOC = 0x13c0;\\n uint256 internal constant T1_Y_LOC = 0x13e0;\\n uint256 internal constant T2_X_LOC = 0x1400;\\n uint256 internal constant T2_Y_LOC = 0x1420;\\n uint256 internal constant T3_X_LOC = 0x1440;\\n uint256 internal constant T3_Y_LOC = 0x1460;\\n uint256 internal constant T4_X_LOC = 0x1480;\\n uint256 internal constant T4_Y_LOC = 0x14a0;\\n\\n uint256 internal constant W1_EVAL_LOC = 0x1600;\\n uint256 internal constant W2_EVAL_LOC = 0x1620;\\n uint256 internal constant W3_EVAL_LOC = 0x1640;\\n uint256 internal constant W4_EVAL_LOC = 0x1660;\\n uint256 internal constant S_EVAL_LOC = 0x1680;\\n uint256 internal constant Z_EVAL_LOC = 0x16a0;\\n uint256 internal constant Z_LOOKUP_EVAL_LOC = 0x16c0;\\n uint256 internal constant Q1_EVAL_LOC = 0x16e0;\\n uint256 internal constant Q2_EVAL_LOC = 0x1700;\\n uint256 internal constant Q3_EVAL_LOC = 0x1720;\\n uint256 internal constant Q4_EVAL_LOC = 0x1740;\\n uint256 internal constant QM_EVAL_LOC = 0x1760;\\n uint256 internal constant QC_EVAL_LOC = 0x1780;\\n uint256 internal constant QARITH_EVAL_LOC = 0x17a0;\\n uint256 internal constant QSORT_EVAL_LOC = 0x17c0;\\n uint256 internal constant QELLIPTIC_EVAL_LOC = 0x17e0;\\n uint256 internal constant QAUX_EVAL_LOC = 0x1800;\\n uint256 internal constant TABLE1_EVAL_LOC = 0x1840;\\n uint256 internal constant TABLE2_EVAL_LOC = 0x1860;\\n uint256 internal constant TABLE3_EVAL_LOC = 0x1880;\\n uint256 internal constant TABLE4_EVAL_LOC = 0x18a0;\\n uint256 internal constant TABLE_TYPE_EVAL_LOC = 0x18c0;\\n uint256 internal constant ID1_EVAL_LOC = 0x18e0;\\n uint256 internal constant ID2_EVAL_LOC = 0x1900;\\n uint256 internal constant ID3_EVAL_LOC = 0x1920;\\n uint256 internal constant ID4_EVAL_LOC = 0x1940;\\n uint256 internal constant SIGMA1_EVAL_LOC = 0x1960;\\n uint256 internal constant SIGMA2_EVAL_LOC = 0x1980;\\n uint256 internal constant SIGMA3_EVAL_LOC = 0x19a0;\\n uint256 internal constant SIGMA4_EVAL_LOC = 0x19c0;\\n uint256 internal constant W1_OMEGA_EVAL_LOC = 0x19e0;\\n uint256 internal constant W2_OMEGA_EVAL_LOC = 0x2000;\\n uint256 internal constant W3_OMEGA_EVAL_LOC = 0x2020;\\n uint256 internal constant W4_OMEGA_EVAL_LOC = 0x2040;\\n uint256 internal constant S_OMEGA_EVAL_LOC = 0x2060;\\n uint256 internal constant Z_OMEGA_EVAL_LOC = 0x2080;\\n uint256 internal constant Z_LOOKUP_OMEGA_EVAL_LOC = 0x20a0;\\n uint256 internal constant TABLE1_OMEGA_EVAL_LOC = 0x20c0;\\n uint256 internal constant TABLE2_OMEGA_EVAL_LOC = 0x20e0;\\n uint256 internal constant TABLE3_OMEGA_EVAL_LOC = 0x2100;\\n uint256 internal constant TABLE4_OMEGA_EVAL_LOC = 0x2120;\\n\\n uint256 internal constant PI_Z_X_LOC = 0x2300;\\n uint256 internal constant PI_Z_Y_LOC = 0x2320;\\n uint256 internal constant PI_Z_OMEGA_X_LOC = 0x2340;\\n uint256 internal constant PI_Z_OMEGA_Y_LOC = 0x2360;\\n\\n // Used for elliptic widget. These are alias names for wire + shifted wire evaluations\\n uint256 internal constant X1_EVAL_LOC = W2_EVAL_LOC;\\n uint256 internal constant X2_EVAL_LOC = W1_OMEGA_EVAL_LOC;\\n uint256 internal constant X3_EVAL_LOC = W2_OMEGA_EVAL_LOC;\\n uint256 internal constant Y1_EVAL_LOC = W3_EVAL_LOC;\\n uint256 internal constant Y2_EVAL_LOC = W4_OMEGA_EVAL_LOC;\\n uint256 internal constant Y3_EVAL_LOC = W3_OMEGA_EVAL_LOC;\\n uint256 internal constant QBETA_LOC = Q3_EVAL_LOC;\\n uint256 internal constant QBETA_SQR_LOC = Q4_EVAL_LOC;\\n uint256 internal constant QSIGN_LOC = Q1_EVAL_LOC;\\n\\n // ### CHALLENGES MEMORY OFFSETS\\n\\n uint256 internal constant C_BETA_LOC = 0x2600;\\n uint256 internal constant C_GAMMA_LOC = 0x2620;\\n uint256 internal constant C_ALPHA_LOC = 0x2640;\\n uint256 internal constant C_ETA_LOC = 0x2660;\\n uint256 internal constant C_ETA_SQR_LOC = 0x2680;\\n uint256 internal constant C_ETA_CUBE_LOC = 0x26a0;\\n\\n uint256 internal constant C_ZETA_LOC = 0x26c0;\\n uint256 internal constant C_CURRENT_LOC = 0x26e0;\\n uint256 internal constant C_V0_LOC = 0x2700;\\n uint256 internal constant C_V1_LOC = 0x2720;\\n uint256 internal constant C_V2_LOC = 0x2740;\\n uint256 internal constant C_V3_LOC = 0x2760;\\n uint256 internal constant C_V4_LOC = 0x2780;\\n uint256 internal constant C_V5_LOC = 0x27a0;\\n uint256 internal constant C_V6_LOC = 0x27c0;\\n uint256 internal constant C_V7_LOC = 0x27e0;\\n uint256 internal constant C_V8_LOC = 0x2800;\\n uint256 internal constant C_V9_LOC = 0x2820;\\n uint256 internal constant C_V10_LOC = 0x2840;\\n uint256 internal constant C_V11_LOC = 0x2860;\\n uint256 internal constant C_V12_LOC = 0x2880;\\n uint256 internal constant C_V13_LOC = 0x28a0;\\n uint256 internal constant C_V14_LOC = 0x28c0;\\n uint256 internal constant C_V15_LOC = 0x28e0;\\n uint256 internal constant C_V16_LOC = 0x2900;\\n uint256 internal constant C_V17_LOC = 0x2920;\\n uint256 internal constant C_V18_LOC = 0x2940;\\n uint256 internal constant C_V19_LOC = 0x2960;\\n uint256 internal constant C_V20_LOC = 0x2980;\\n uint256 internal constant C_V21_LOC = 0x29a0;\\n uint256 internal constant C_V22_LOC = 0x29c0;\\n uint256 internal constant C_V23_LOC = 0x29e0;\\n uint256 internal constant C_V24_LOC = 0x2a00;\\n uint256 internal constant C_V25_LOC = 0x2a20;\\n uint256 internal constant C_V26_LOC = 0x2a40;\\n uint256 internal constant C_V27_LOC = 0x2a60;\\n uint256 internal constant C_V28_LOC = 0x2a80;\\n uint256 internal constant C_V29_LOC = 0x2aa0;\\n uint256 internal constant C_V30_LOC = 0x2ac0;\\n\\n uint256 internal constant C_U_LOC = 0x2b00;\\n\\n // ### LOCAL VARIABLES MEMORY OFFSETS\\n uint256 internal constant DELTA_NUMERATOR_LOC = 0x3000;\\n uint256 internal constant DELTA_DENOMINATOR_LOC = 0x3020;\\n uint256 internal constant ZETA_POW_N_LOC = 0x3040;\\n uint256 internal constant PUBLIC_INPUT_DELTA_LOC = 0x3060;\\n uint256 internal constant ZERO_POLY_LOC = 0x3080;\\n uint256 internal constant L_START_LOC = 0x30a0;\\n uint256 internal constant L_END_LOC = 0x30c0;\\n uint256 internal constant R_ZERO_EVAL_LOC = 0x30e0;\\n\\n uint256 internal constant PLOOKUP_DELTA_NUMERATOR_LOC = 0x3100;\\n uint256 internal constant PLOOKUP_DELTA_DENOMINATOR_LOC = 0x3120;\\n uint256 internal constant PLOOKUP_DELTA_LOC = 0x3140;\\n\\n uint256 internal constant ACCUMULATOR_X_LOC = 0x3160;\\n uint256 internal constant ACCUMULATOR_Y_LOC = 0x3180;\\n uint256 internal constant ACCUMULATOR2_X_LOC = 0x31a0;\\n uint256 internal constant ACCUMULATOR2_Y_LOC = 0x31c0;\\n uint256 internal constant PAIRING_LHS_X_LOC = 0x31e0;\\n uint256 internal constant PAIRING_LHS_Y_LOC = 0x3200;\\n uint256 internal constant PAIRING_RHS_X_LOC = 0x3220;\\n uint256 internal constant PAIRING_RHS_Y_LOC = 0x3240;\\n\\n // misc stuff\\n uint256 internal constant OMEGA_INVERSE_LOC = 0x3300;\\n uint256 internal constant C_ALPHA_SQR_LOC = 0x3320;\\n uint256 internal constant C_ALPHA_CUBE_LOC = 0x3340;\\n uint256 internal constant C_ALPHA_QUAD_LOC = 0x3360;\\n uint256 internal constant C_ALPHA_BASE_LOC = 0x3380;\\n\\n // ### RECURSION VARIABLE MEMORY LOCATIONS\\n uint256 internal constant RECURSIVE_P1_X_LOC = 0x3400;\\n uint256 internal constant RECURSIVE_P1_Y_LOC = 0x3420;\\n uint256 internal constant RECURSIVE_P2_X_LOC = 0x3440;\\n uint256 internal constant RECURSIVE_P2_Y_LOC = 0x3460;\\n uint256 internal constant PUBLIC_INPUTS_HASH_LOCATION = 0x3480;\\n\\n // sub-identity storage\\n uint256 internal constant PERMUTATION_IDENTITY = 0x3500;\\n uint256 internal constant PLOOKUP_IDENTITY = 0x3520;\\n uint256 internal constant ARITHMETIC_IDENTITY = 0x3540;\\n uint256 internal constant SORT_IDENTITY = 0x3560;\\n uint256 internal constant ELLIPTIC_IDENTITY = 0x3580;\\n uint256 internal constant AUX_IDENTITY = 0x35a0;\\n uint256 internal constant AUX_NON_NATIVE_FIELD_EVALUATION = 0x35c0;\\n uint256 internal constant AUX_LIMB_ACCUMULATOR_EVALUATION = 0x35e0;\\n uint256 internal constant AUX_RAM_CONSISTENCY_EVALUATION = 0x3600;\\n uint256 internal constant AUX_ROM_CONSISTENCY_EVALUATION = 0x3620;\\n uint256 internal constant AUX_MEMORY_EVALUATION = 0x3640;\\n\\n uint256 internal constant QUOTIENT_EVAL_LOC = 0x3660;\\n uint256 internal constant ZERO_POLY_INVERSE_LOC = 0x3680;\\n\\n // when hashing public inputs we use memory at NU_CHALLENGE_INPUT_LOC_A, as the hash input size is unknown at compile time\\n uint256 internal constant NU_CHALLENGE_INPUT_LOC_A = 0x36a0;\\n uint256 internal constant NU_CHALLENGE_INPUT_LOC_B = 0x36c0;\\n uint256 internal constant NU_CHALLENGE_INPUT_LOC_C = 0x36e0;\\n\\n bytes4 internal constant INVALID_VERIFICATION_KEY_SELECTOR = 0x7e5769bf;\\n bytes4 internal constant POINT_NOT_ON_CURVE_SELECTOR = 0xa3dad654;\\n bytes4 internal constant PUBLIC_INPUT_INVALID_BN128_G1_POINT_SELECTOR = 0xeba9f4a6;\\n bytes4 internal constant PUBLIC_INPUT_GE_P_SELECTOR = 0x374a972f;\\n bytes4 internal constant MOD_EXP_FAILURE_SELECTOR = 0xf894a7bc;\\n bytes4 internal constant PAIRING_PREAMBLE_FAILED_SELECTOR = 0x01882d81;\\n bytes4 internal constant OPENING_COMMITMENT_FAILED_SELECTOR = 0x4e719763;\\n bytes4 internal constant PAIRING_FAILED_SELECTOR = 0xd71fd263;\\n\\n uint256 internal constant ETA_INPUT_LENGTH = 0xc0; // W1, W2, W3 = 6 * 0x20 bytes\\n\\n // We need to hash 41 field elements when generating the NU challenge\\n // w1, w2, w3, w4, s, z, z_lookup, q1, q2, q3, q4, qm, qc, qarith (14)\\n // qsort, qelliptic, qaux, sigma1, sigma2, sigma, sigma4, (7)\\n // table1, table2, table3, table4, tabletype, id1, id2, id3, id4, (9)\\n // w1_omega, w2_omega, w3_omega, w4_omega, s_omega, z_omega, z_lookup_omega, (7)\\n // table1_omega, table2_omega, table3_omega, table4_omega (4)\\n uint256 internal constant NU_INPUT_LENGTH = 0x520; // 0x520 = 41 * 0x20\\n\\n // There are ELEVEN G1 group elements added into the transcript in the `beta` round, that we need to skip over\\n // W1, W2, W3, W4, S, Z, Z_LOOKUP, T1, T2, T3, T4\\n uint256 internal constant NU_CALLDATA_SKIP_LENGTH = 0x2c0; // 11 * 0x40 = 0x2c0\\n\\n uint256 internal constant NEGATIVE_INVERSE_OF_2_MODULO_P =\\n 0x183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f8000000;\\n uint256 internal constant LIMB_SIZE = 0x100000000000000000; // 2<<68\\n uint256 internal constant SUBLIMB_SHIFT = 0x4000; // 2<<14\\n\\n // y^2 = x^3 + ax + b\\n // for Grumpkin, a = 0 and b = -17. We use b in a custom gate relation that evaluates elliptic curve arithmetic\\n uint256 internal constant GRUMPKIN_CURVE_B_PARAMETER_NEGATED = 17;\\n\\n error INVALID_VERIFICATION_KEY();\\n error POINT_NOT_ON_CURVE();\\n error PUBLIC_INPUT_COUNT_INVALID(uint256 expected, uint256 actual);\\n error PUBLIC_INPUT_INVALID_BN128_G1_POINT();\\n error PUBLIC_INPUT_GE_P();\\n error MOD_EXP_FAILURE();\\n error PAIRING_PREAMBLE_FAILED();\\n error OPENING_COMMITMENT_FAILED();\\n error PAIRING_FAILED();\\n\\n function getVerificationKeyHash() public pure virtual returns (bytes32);\\n\\n /**\\n * @dev We assume that the verification key loaded by this function is constant as we only verify it on deployment\\n */\\n function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure virtual;\\n\\n constructor() { \\n loadVerificationKey(N_LOC, OMEGA_INVERSE_LOC);\\n\\n // We verify that all of the EC points in the verification key lie on the bn128 curve. \\n assembly {\\n let q := 21888242871839275222246405745257275088696311157297823662689037894645226208583 // EC group order\\n\\n let success := 1\\n\\n // VALIDATE Q1\\n {\\n let x := mload(Q1_X_LOC)\\n let y := mload(Q1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE Q2\\n {\\n let x := mload(Q2_X_LOC)\\n let y := mload(Q2_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE Q3\\n {\\n let x := mload(Q3_X_LOC)\\n let y := mload(Q3_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE Q4\\n {\\n let x := mload(Q4_X_LOC)\\n let y := mload(Q4_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n // VALIDATE QM\\n {\\n let x := mload(QM_X_LOC)\\n let y := mload(QM_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE QC\\n {\\n let x := mload(QC_X_LOC)\\n let y := mload(QC_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE QARITH\\n {\\n let x := mload(QARITH_X_LOC)\\n let y := mload(QARITH_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE QSORT\\n {\\n let x := mload(QSORT_X_LOC)\\n let y := mload(QSORT_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE QELLIPTIC\\n {\\n let x := mload(QELLIPTIC_X_LOC)\\n let y := mload(QELLIPTIC_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE QAUX\\n {\\n let x := mload(QAUX_X_LOC)\\n let y := mload(QAUX_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE SIGMA1\\n {\\n let x := mload(SIGMA1_X_LOC)\\n let y := mload(SIGMA1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE SIGMA2\\n {\\n let x := mload(SIGMA2_X_LOC)\\n let y := mload(SIGMA2_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE SIGMA3\\n {\\n let x := mload(SIGMA3_X_LOC)\\n let y := mload(SIGMA3_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE SIGMA4\\n {\\n let x := mload(SIGMA4_X_LOC)\\n let y := mload(SIGMA4_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE TABLE1\\n {\\n let x := mload(TABLE1_X_LOC)\\n let y := mload(TABLE1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n } \\n // VALIDATE TABLE2\\n {\\n let x := mload(TABLE2_X_LOC)\\n let y := mload(TABLE2_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n } \\n // VALIDATE TABLE3\\n {\\n let x := mload(TABLE3_X_LOC)\\n let y := mload(TABLE3_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n } \\n // VALIDATE TABLE4\\n {\\n let x := mload(TABLE4_X_LOC)\\n let y := mload(TABLE4_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n } \\n // VALIDATE TABLE_TYPE\\n {\\n let x := mload(TABLE_TYPE_X_LOC)\\n let y := mload(TABLE_TYPE_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE ID1\\n {\\n let x := mload(ID1_X_LOC)\\n let y := mload(ID1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE ID2\\n {\\n let x := mload(ID2_X_LOC)\\n let y := mload(ID2_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE ID3\\n {\\n let x := mload(ID3_X_LOC)\\n let y := mload(ID3_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n // VALIDATE ID4\\n {\\n let x := mload(ID4_X_LOC)\\n let y := mload(ID4_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)))\\n }\\n\\n if iszero(success) {\\n mstore(0x0, INVALID_VERIFICATION_KEY_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n }\\n }\\n\\n /**\\n * @notice Verify a Ultra Plonk proof\\n * @param _proof - The serialized proof\\n * @param _publicInputs - An array of the public inputs\\n * @return True if proof is valid, reverts otherwise\\n */\\n function verify(bytes calldata _proof, bytes32[] calldata _publicInputs) external view returns (bool) {\\n loadVerificationKey(N_LOC, OMEGA_INVERSE_LOC);\\n\\n uint256 requiredPublicInputCount;\\n assembly {\\n requiredPublicInputCount := mload(NUM_INPUTS_LOC)\\n }\\n if (requiredPublicInputCount != _publicInputs.length) {\\n revert PUBLIC_INPUT_COUNT_INVALID(requiredPublicInputCount, _publicInputs.length);\\n }\\n\\n assembly {\\n let q := 21888242871839275222246405745257275088696311157297823662689037894645226208583 // EC group order\\n let p := 21888242871839275222246405745257275088548364400416034343698204186575808495617 // Prime field order\\n\\n /**\\n * LOAD PROOF FROM CALLDATA\\n */\\n {\\n let data_ptr := add(calldataload(0x04), 0x24)\\n\\n mstore(W1_Y_LOC, mod(calldataload(data_ptr), q))\\n mstore(W1_X_LOC, mod(calldataload(add(data_ptr, 0x20)), q))\\n\\n mstore(W2_Y_LOC, mod(calldataload(add(data_ptr, 0x40)), q))\\n mstore(W2_X_LOC, mod(calldataload(add(data_ptr, 0x60)), q))\\n\\n mstore(W3_Y_LOC, mod(calldataload(add(data_ptr, 0x80)), q))\\n mstore(W3_X_LOC, mod(calldataload(add(data_ptr, 0xa0)), q))\\n\\n mstore(W4_Y_LOC, mod(calldataload(add(data_ptr, 0xc0)), q))\\n mstore(W4_X_LOC, mod(calldataload(add(data_ptr, 0xe0)), q))\\n\\n mstore(S_Y_LOC, mod(calldataload(add(data_ptr, 0x100)), q))\\n mstore(S_X_LOC, mod(calldataload(add(data_ptr, 0x120)), q))\\n mstore(Z_Y_LOC, mod(calldataload(add(data_ptr, 0x140)), q))\\n mstore(Z_X_LOC, mod(calldataload(add(data_ptr, 0x160)), q))\\n mstore(Z_LOOKUP_Y_LOC, mod(calldataload(add(data_ptr, 0x180)), q))\\n mstore(Z_LOOKUP_X_LOC, mod(calldataload(add(data_ptr, 0x1a0)), q))\\n mstore(T1_Y_LOC, mod(calldataload(add(data_ptr, 0x1c0)), q))\\n mstore(T1_X_LOC, mod(calldataload(add(data_ptr, 0x1e0)), q))\\n\\n mstore(T2_Y_LOC, mod(calldataload(add(data_ptr, 0x200)), q))\\n mstore(T2_X_LOC, mod(calldataload(add(data_ptr, 0x220)), q))\\n\\n mstore(T3_Y_LOC, mod(calldataload(add(data_ptr, 0x240)), q))\\n mstore(T3_X_LOC, mod(calldataload(add(data_ptr, 0x260)), q))\\n\\n mstore(T4_Y_LOC, mod(calldataload(add(data_ptr, 0x280)), q))\\n mstore(T4_X_LOC, mod(calldataload(add(data_ptr, 0x2a0)), q))\\n\\n mstore(W1_EVAL_LOC, mod(calldataload(add(data_ptr, 0x2c0)), p))\\n mstore(W2_EVAL_LOC, mod(calldataload(add(data_ptr, 0x2e0)), p))\\n mstore(W3_EVAL_LOC, mod(calldataload(add(data_ptr, 0x300)), p))\\n mstore(W4_EVAL_LOC, mod(calldataload(add(data_ptr, 0x320)), p))\\n mstore(S_EVAL_LOC, mod(calldataload(add(data_ptr, 0x340)), p))\\n mstore(Z_EVAL_LOC, mod(calldataload(add(data_ptr, 0x360)), p))\\n mstore(Z_LOOKUP_EVAL_LOC, mod(calldataload(add(data_ptr, 0x380)), p))\\n mstore(Q1_EVAL_LOC, mod(calldataload(add(data_ptr, 0x3a0)), p))\\n mstore(Q2_EVAL_LOC, mod(calldataload(add(data_ptr, 0x3c0)), p))\\n mstore(Q3_EVAL_LOC, mod(calldataload(add(data_ptr, 0x3e0)), p))\\n mstore(Q4_EVAL_LOC, mod(calldataload(add(data_ptr, 0x400)), p))\\n mstore(QM_EVAL_LOC, mod(calldataload(add(data_ptr, 0x420)), p))\\n mstore(QC_EVAL_LOC, mod(calldataload(add(data_ptr, 0x440)), p))\\n mstore(QARITH_EVAL_LOC, mod(calldataload(add(data_ptr, 0x460)), p))\\n mstore(QSORT_EVAL_LOC, mod(calldataload(add(data_ptr, 0x480)), p))\\n mstore(QELLIPTIC_EVAL_LOC, mod(calldataload(add(data_ptr, 0x4a0)), p))\\n mstore(QAUX_EVAL_LOC, mod(calldataload(add(data_ptr, 0x4c0)), p))\\n\\n mstore(SIGMA1_EVAL_LOC, mod(calldataload(add(data_ptr, 0x4e0)), p))\\n mstore(SIGMA2_EVAL_LOC, mod(calldataload(add(data_ptr, 0x500)), p))\\n\\n mstore(SIGMA3_EVAL_LOC, mod(calldataload(add(data_ptr, 0x520)), p))\\n mstore(SIGMA4_EVAL_LOC, mod(calldataload(add(data_ptr, 0x540)), p))\\n\\n mstore(TABLE1_EVAL_LOC, mod(calldataload(add(data_ptr, 0x560)), p))\\n mstore(TABLE2_EVAL_LOC, mod(calldataload(add(data_ptr, 0x580)), p))\\n mstore(TABLE3_EVAL_LOC, mod(calldataload(add(data_ptr, 0x5a0)), p))\\n mstore(TABLE4_EVAL_LOC, mod(calldataload(add(data_ptr, 0x5c0)), p))\\n mstore(TABLE_TYPE_EVAL_LOC, mod(calldataload(add(data_ptr, 0x5e0)), p))\\n\\n mstore(ID1_EVAL_LOC, mod(calldataload(add(data_ptr, 0x600)), p))\\n mstore(ID2_EVAL_LOC, mod(calldataload(add(data_ptr, 0x620)), p))\\n mstore(ID3_EVAL_LOC, mod(calldataload(add(data_ptr, 0x640)), p))\\n mstore(ID4_EVAL_LOC, mod(calldataload(add(data_ptr, 0x660)), p))\\n\\n mstore(W1_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x680)), p))\\n mstore(W2_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x6a0)), p))\\n mstore(W3_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x6c0)), p))\\n mstore(W4_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x6e0)), p))\\n mstore(S_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x700)), p))\\n\\n mstore(Z_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x720)), p))\\n\\n mstore(Z_LOOKUP_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x740)), p))\\n mstore(TABLE1_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x760)), p))\\n mstore(TABLE2_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x780)), p))\\n mstore(TABLE3_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x7a0)), p))\\n mstore(TABLE4_OMEGA_EVAL_LOC, mod(calldataload(add(data_ptr, 0x7c0)), p))\\n\\n mstore(PI_Z_Y_LOC, mod(calldataload(add(data_ptr, 0x7e0)), q))\\n mstore(PI_Z_X_LOC, mod(calldataload(add(data_ptr, 0x800)), q))\\n\\n mstore(PI_Z_OMEGA_Y_LOC, mod(calldataload(add(data_ptr, 0x820)), q))\\n mstore(PI_Z_OMEGA_X_LOC, mod(calldataload(add(data_ptr, 0x840)), q))\\n }\\n\\n /**\\n * LOAD RECURSIVE PROOF INTO MEMORY\\n */\\n {\\n if mload(CONTAINS_RECURSIVE_PROOF_LOC) {\\n let public_inputs_ptr := add(calldataload(0x24), 0x24)\\n let index_counter := add(shl(5, mload(RECURSIVE_PROOF_PUBLIC_INPUT_INDICES_LOC)), public_inputs_ptr)\\n\\n let x0 := calldataload(index_counter)\\n x0 := add(x0, shl(68, calldataload(add(index_counter, 0x20))))\\n x0 := add(x0, shl(136, calldataload(add(index_counter, 0x40))))\\n x0 := add(x0, shl(204, calldataload(add(index_counter, 0x60))))\\n let y0 := calldataload(add(index_counter, 0x80))\\n y0 := add(y0, shl(68, calldataload(add(index_counter, 0xa0))))\\n y0 := add(y0, shl(136, calldataload(add(index_counter, 0xc0))))\\n y0 := add(y0, shl(204, calldataload(add(index_counter, 0xe0))))\\n let x1 := calldataload(add(index_counter, 0x100))\\n x1 := add(x1, shl(68, calldataload(add(index_counter, 0x120))))\\n x1 := add(x1, shl(136, calldataload(add(index_counter, 0x140))))\\n x1 := add(x1, shl(204, calldataload(add(index_counter, 0x160))))\\n let y1 := calldataload(add(index_counter, 0x180))\\n y1 := add(y1, shl(68, calldataload(add(index_counter, 0x1a0))))\\n y1 := add(y1, shl(136, calldataload(add(index_counter, 0x1c0))))\\n y1 := add(y1, shl(204, calldataload(add(index_counter, 0x1e0))))\\n mstore(RECURSIVE_P1_X_LOC, x0)\\n mstore(RECURSIVE_P1_Y_LOC, y0)\\n mstore(RECURSIVE_P2_X_LOC, x1)\\n mstore(RECURSIVE_P2_Y_LOC, y1)\\n\\n // validate these are valid bn128 G1 points\\n if iszero(and(and(lt(x0, q), lt(x1, q)), and(lt(y0, q), lt(y1, q)))) {\\n mstore(0x00, PUBLIC_INPUT_INVALID_BN128_G1_POINT_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n }\\n }\\n\\n {\\n /**\\n * Generate initial challenge\\n */\\n mstore(0x00, shl(224, mload(N_LOC)))\\n mstore(0x04, shl(224, mload(NUM_INPUTS_LOC)))\\n let challenge := keccak256(0x00, 0x08)\\n\\n /**\\n * Generate eta challenge\\n */\\n mstore(PUBLIC_INPUTS_HASH_LOCATION, challenge)\\n // The public input location is stored at 0x24, we then add 0x24 to skip selector and the length of public inputs\\n let public_inputs_start := add(calldataload(0x24), 0x24)\\n // copy the public inputs over\\n let public_input_size := mul(mload(NUM_INPUTS_LOC), 0x20)\\n calldatacopy(add(PUBLIC_INPUTS_HASH_LOCATION, 0x20), public_inputs_start, public_input_size)\\n\\n // copy W1, W2, W3 into challenge. Each point is 0x40 bytes, so load 0xc0 = 3 * 0x40 bytes (ETA input length)\\n let w_start := add(calldataload(0x04), 0x24)\\n calldatacopy(add(add(PUBLIC_INPUTS_HASH_LOCATION, 0x20), public_input_size), w_start, ETA_INPUT_LENGTH)\\n\\n // Challenge is the old challenge + public inputs + W1, W2, W3 (0x20 + public_input_size + 0xc0)\\n let challenge_bytes_size := add(0x20, add(public_input_size, ETA_INPUT_LENGTH))\\n\\n challenge := keccak256(PUBLIC_INPUTS_HASH_LOCATION, challenge_bytes_size)\\n {\\n let eta := mod(challenge, p)\\n mstore(C_ETA_LOC, eta)\\n mstore(C_ETA_SQR_LOC, mulmod(eta, eta, p))\\n mstore(C_ETA_CUBE_LOC, mulmod(mload(C_ETA_SQR_LOC), eta, p))\\n }\\n\\n /**\\n * Generate beta challenge\\n */\\n mstore(0x00, challenge)\\n mstore(0x20, mload(W4_Y_LOC))\\n mstore(0x40, mload(W4_X_LOC))\\n mstore(0x60, mload(S_Y_LOC))\\n mstore(0x80, mload(S_X_LOC))\\n challenge := keccak256(0x00, 0xa0)\\n mstore(C_BETA_LOC, mod(challenge, p))\\n\\n /**\\n * Generate gamma challenge\\n */\\n mstore(0x00, challenge)\\n mstore8(0x20, 0x01)\\n challenge := keccak256(0x00, 0x21)\\n mstore(C_GAMMA_LOC, mod(challenge, p))\\n\\n /**\\n * Generate alpha challenge\\n */\\n mstore(0x00, challenge)\\n mstore(0x20, mload(Z_Y_LOC))\\n mstore(0x40, mload(Z_X_LOC))\\n mstore(0x60, mload(Z_LOOKUP_Y_LOC))\\n mstore(0x80, mload(Z_LOOKUP_X_LOC))\\n challenge := keccak256(0x00, 0xa0)\\n mstore(C_ALPHA_LOC, mod(challenge, p))\\n\\n /**\\n * Compute and store some powers of alpha for future computations\\n */\\n let alpha := mload(C_ALPHA_LOC)\\n mstore(C_ALPHA_SQR_LOC, mulmod(alpha, alpha, p))\\n mstore(C_ALPHA_CUBE_LOC, mulmod(mload(C_ALPHA_SQR_LOC), alpha, p))\\n mstore(C_ALPHA_QUAD_LOC, mulmod(mload(C_ALPHA_CUBE_LOC), alpha, p))\\n mstore(C_ALPHA_BASE_LOC, alpha)\\n\\n /**\\n * Generate zeta challenge\\n */\\n mstore(0x00, challenge)\\n mstore(0x20, mload(T1_Y_LOC))\\n mstore(0x40, mload(T1_X_LOC))\\n mstore(0x60, mload(T2_Y_LOC))\\n mstore(0x80, mload(T2_X_LOC))\\n mstore(0xa0, mload(T3_Y_LOC))\\n mstore(0xc0, mload(T3_X_LOC))\\n mstore(0xe0, mload(T4_Y_LOC))\\n mstore(0x100, mload(T4_X_LOC))\\n\\n challenge := keccak256(0x00, 0x120)\\n\\n mstore(C_ZETA_LOC, mod(challenge, p))\\n mstore(C_CURRENT_LOC, challenge)\\n }\\n\\n /**\\n * EVALUATE FIELD OPERATIONS\\n */\\n\\n /**\\n * COMPUTE PUBLIC INPUT DELTA\\n * \\u0394PI = \\u220f\\u1d62\\u2208\\u2113(w\\u1d62 + \\u03b2 \\u03c3(i) + \\u03b3) / \\u220f\\u1d62\\u2208\\u2113(w\\u1d62 + \\u03b2 \\u03c3'(i) + \\u03b3)\\n */\\n {\\n let beta := mload(C_BETA_LOC) // \\u03b2\\n let gamma := mload(C_GAMMA_LOC) // \\u03b3\\n let work_root := mload(OMEGA_LOC) // \\u03c9\\n let numerator_value := 1\\n let denominator_value := 1\\n\\n let p_clone := p // move p to the front of the stack\\n let valid_inputs := true\\n\\n // Load the starting point of the public inputs (jump over the selector and the length of public inputs [0x24])\\n let public_inputs_ptr := add(calldataload(0x24), 0x24)\\n\\n // endpoint_ptr = public_inputs_ptr + num_inputs * 0x20. // every public input is 0x20 bytes\\n let endpoint_ptr := add(public_inputs_ptr, mul(mload(NUM_INPUTS_LOC), 0x20))\\n\\n // root_1 = \\u03b2 * 0x05\\n let root_1 := mulmod(beta, 0x05, p_clone) // k1.\\u03b2\\n // root_2 = \\u03b2 * 0x0c\\n let root_2 := mulmod(beta, 0x0c, p_clone)\\n // @note 0x05 + 0x07 == 0x0c == external coset generator\\n\\n for {} lt(public_inputs_ptr, endpoint_ptr) { public_inputs_ptr := add(public_inputs_ptr, 0x20) } {\\n /**\\n * input = public_input[i]\\n * valid_inputs &= input < p\\n * temp = input + gamma\\n * numerator_value *= (\\u03b2.\\u03c3(i) + w\\u1d62 + \\u03b3) // \\u03c3(i) = 0x05.\\u03c9\\u2071\\n * denominator_value *= (\\u03b2.\\u03c3'(i) + w\\u1d62 + \\u03b3) // \\u03c3'(i) = 0x0c.\\u03c9\\u2071\\n * root_1 *= \\u03c9\\n * root_2 *= \\u03c9\\n */\\n\\n let input := calldataload(public_inputs_ptr)\\n valid_inputs := and(valid_inputs, lt(input, p_clone))\\n let temp := addmod(input, gamma, p_clone)\\n\\n numerator_value := mulmod(numerator_value, add(root_1, temp), p_clone)\\n denominator_value := mulmod(denominator_value, add(root_2, temp), p_clone)\\n\\n root_1 := mulmod(root_1, work_root, p_clone)\\n root_2 := mulmod(root_2, work_root, p_clone)\\n }\\n\\n // Revert if not all public inputs are field elements (i.e. < p)\\n if iszero(valid_inputs) {\\n mstore(0x00, PUBLIC_INPUT_GE_P_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n\\n mstore(DELTA_NUMERATOR_LOC, numerator_value)\\n mstore(DELTA_DENOMINATOR_LOC, denominator_value)\\n }\\n\\n /**\\n * Compute Plookup delta factor [\\u03b3(1 + \\u03b2)]^{n-k}\\n * k = num roots cut out of Z_H = 4\\n */\\n {\\n let delta_base := mulmod(mload(C_GAMMA_LOC), addmod(mload(C_BETA_LOC), 1, p), p)\\n let delta_numerator := delta_base\\n {\\n let exponent := mload(N_LOC)\\n let count := 1\\n for {} lt(count, exponent) { count := add(count, count) } {\\n delta_numerator := mulmod(delta_numerator, delta_numerator, p)\\n }\\n }\\n mstore(PLOOKUP_DELTA_NUMERATOR_LOC, delta_numerator)\\n\\n let delta_denominator := mulmod(delta_base, delta_base, p)\\n delta_denominator := mulmod(delta_denominator, delta_denominator, p)\\n mstore(PLOOKUP_DELTA_DENOMINATOR_LOC, delta_denominator)\\n }\\n /**\\n * Compute lagrange poly and vanishing poly fractions\\n */\\n {\\n /**\\n * vanishing_numerator = zeta\\n * ZETA_POW_N = zeta^n\\n * vanishing_numerator -= 1\\n * accumulating_root = omega_inverse\\n * work_root = p - accumulating_root\\n * domain_inverse = domain_inverse\\n * vanishing_denominator = zeta + work_root\\n * work_root *= accumulating_root\\n * vanishing_denominator *= (zeta + work_root)\\n * work_root *= accumulating_root\\n * vanishing_denominator *= (zeta + work_root)\\n * vanishing_denominator *= (zeta + (zeta + accumulating_root))\\n * work_root = omega\\n * lagrange_numerator = vanishing_numerator * domain_inverse\\n * l_start_denominator = zeta - 1\\n * accumulating_root = work_root^2\\n * l_end_denominator = accumulating_root^2 * work_root * zeta - 1\\n * Note: l_end_denominator term contains a term \\\\omega^5 to cut out 5 roots of unity from vanishing poly\\n */\\n\\n let zeta := mload(C_ZETA_LOC)\\n\\n // compute zeta^n, where n is a power of 2\\n let vanishing_numerator := zeta\\n {\\n // pow_small\\n let exponent := mload(N_LOC)\\n let count := 1\\n for {} lt(count, exponent) { count := add(count, count) } {\\n vanishing_numerator := mulmod(vanishing_numerator, vanishing_numerator, p)\\n }\\n }\\n mstore(ZETA_POW_N_LOC, vanishing_numerator)\\n vanishing_numerator := addmod(vanishing_numerator, sub(p, 1), p)\\n\\n let accumulating_root := mload(OMEGA_INVERSE_LOC)\\n let work_root := sub(p, accumulating_root)\\n let domain_inverse := mload(DOMAIN_INVERSE_LOC)\\n\\n let vanishing_denominator := addmod(zeta, work_root, p)\\n work_root := mulmod(work_root, accumulating_root, p)\\n vanishing_denominator := mulmod(vanishing_denominator, addmod(zeta, work_root, p), p)\\n work_root := mulmod(work_root, accumulating_root, p)\\n vanishing_denominator := mulmod(vanishing_denominator, addmod(zeta, work_root, p), p)\\n vanishing_denominator :=\\n mulmod(vanishing_denominator, addmod(zeta, mulmod(work_root, accumulating_root, p), p), p)\\n\\n work_root := mload(OMEGA_LOC)\\n\\n let lagrange_numerator := mulmod(vanishing_numerator, domain_inverse, p)\\n let l_start_denominator := addmod(zeta, sub(p, 1), p)\\n\\n accumulating_root := mulmod(work_root, work_root, p)\\n\\n let l_end_denominator :=\\n addmod(\\n mulmod(mulmod(mulmod(accumulating_root, accumulating_root, p), work_root, p), zeta, p), sub(p, 1), p\\n )\\n\\n /**\\n * Compute inversions using Montgomery's batch inversion trick\\n */\\n let accumulator := mload(DELTA_DENOMINATOR_LOC)\\n let t0 := accumulator\\n accumulator := mulmod(accumulator, vanishing_denominator, p)\\n let t1 := accumulator\\n accumulator := mulmod(accumulator, vanishing_numerator, p)\\n let t2 := accumulator\\n accumulator := mulmod(accumulator, l_start_denominator, p)\\n let t3 := accumulator\\n accumulator := mulmod(accumulator, mload(PLOOKUP_DELTA_DENOMINATOR_LOC), p)\\n let t4 := accumulator\\n {\\n mstore(0, 0x20)\\n mstore(0x20, 0x20)\\n mstore(0x40, 0x20)\\n mstore(0x60, mulmod(accumulator, l_end_denominator, p))\\n mstore(0x80, sub(p, 2))\\n mstore(0xa0, p)\\n if iszero(staticcall(gas(), 0x05, 0x00, 0xc0, 0x00, 0x20)) {\\n mstore(0x0, MOD_EXP_FAILURE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n accumulator := mload(0x00)\\n }\\n\\n t4 := mulmod(accumulator, t4, p)\\n accumulator := mulmod(accumulator, l_end_denominator, p)\\n\\n t3 := mulmod(accumulator, t3, p)\\n accumulator := mulmod(accumulator, mload(PLOOKUP_DELTA_DENOMINATOR_LOC), p)\\n\\n t2 := mulmod(accumulator, t2, p)\\n accumulator := mulmod(accumulator, l_start_denominator, p)\\n\\n t1 := mulmod(accumulator, t1, p)\\n accumulator := mulmod(accumulator, vanishing_numerator, p)\\n\\n t0 := mulmod(accumulator, t0, p)\\n accumulator := mulmod(accumulator, vanishing_denominator, p)\\n\\n accumulator := mulmod(mulmod(accumulator, accumulator, p), mload(DELTA_DENOMINATOR_LOC), p)\\n\\n mstore(PUBLIC_INPUT_DELTA_LOC, mulmod(mload(DELTA_NUMERATOR_LOC), accumulator, p))\\n mstore(ZERO_POLY_LOC, mulmod(vanishing_numerator, t0, p))\\n mstore(ZERO_POLY_INVERSE_LOC, mulmod(vanishing_denominator, t1, p))\\n mstore(L_START_LOC, mulmod(lagrange_numerator, t2, p))\\n mstore(PLOOKUP_DELTA_LOC, mulmod(mload(PLOOKUP_DELTA_NUMERATOR_LOC), t3, p))\\n mstore(L_END_LOC, mulmod(lagrange_numerator, t4, p))\\n }\\n\\n /**\\n * UltraPlonk Widget Ordering:\\n *\\n * 1. Permutation widget\\n * 2. Plookup widget\\n * 3. Arithmetic widget\\n * 4. Fixed base widget (?)\\n * 5. GenPermSort widget\\n * 6. Elliptic widget\\n * 7. Auxiliary widget\\n */\\n\\n /**\\n * COMPUTE PERMUTATION WIDGET EVALUATION\\n */\\n {\\n let alpha := mload(C_ALPHA_LOC)\\n let beta := mload(C_BETA_LOC)\\n let gamma := mload(C_GAMMA_LOC)\\n\\n /**\\n * t1 = (W1 + gamma + beta * ID1) * (W2 + gamma + beta * ID2)\\n * t2 = (W3 + gamma + beta * ID3) * (W4 + gamma + beta * ID4)\\n * result = alpha_base * z_eval * t1 * t2\\n * t1 = (W1 + gamma + beta * sigma_1_eval) * (W2 + gamma + beta * sigma_2_eval)\\n * t2 = (W2 + gamma + beta * sigma_3_eval) * (W3 + gamma + beta * sigma_4_eval)\\n * result -= (alpha_base * z_omega_eval * t1 * t2)\\n */\\n let t1 :=\\n mulmod(\\n add(add(mload(W1_EVAL_LOC), gamma), mulmod(beta, mload(ID1_EVAL_LOC), p)),\\n add(add(mload(W2_EVAL_LOC), gamma), mulmod(beta, mload(ID2_EVAL_LOC), p)),\\n p\\n )\\n let t2 :=\\n mulmod(\\n add(add(mload(W3_EVAL_LOC), gamma), mulmod(beta, mload(ID3_EVAL_LOC), p)),\\n add(add(mload(W4_EVAL_LOC), gamma), mulmod(beta, mload(ID4_EVAL_LOC), p)),\\n p\\n )\\n let result := mulmod(mload(C_ALPHA_BASE_LOC), mulmod(mload(Z_EVAL_LOC), mulmod(t1, t2, p), p), p)\\n t1 :=\\n mulmod(\\n add(add(mload(W1_EVAL_LOC), gamma), mulmod(beta, mload(SIGMA1_EVAL_LOC), p)),\\n add(add(mload(W2_EVAL_LOC), gamma), mulmod(beta, mload(SIGMA2_EVAL_LOC), p)),\\n p\\n )\\n t2 :=\\n mulmod(\\n add(add(mload(W3_EVAL_LOC), gamma), mulmod(beta, mload(SIGMA3_EVAL_LOC), p)),\\n add(add(mload(W4_EVAL_LOC), gamma), mulmod(beta, mload(SIGMA4_EVAL_LOC), p)),\\n p\\n )\\n result :=\\n addmod(\\n result,\\n sub(p, mulmod(mload(C_ALPHA_BASE_LOC), mulmod(mload(Z_OMEGA_EVAL_LOC), mulmod(t1, t2, p), p), p)),\\n p\\n )\\n\\n /**\\n * alpha_base *= alpha\\n * result += alpha_base . (L_{n-k}(\\u0293) . (z(\\u0293.\\u03c9) - \\u2206_{PI}))\\n * alpha_base *= alpha\\n * result += alpha_base . (L_1(\\u0293)(Z(\\u0293) - 1))\\n * alpha_Base *= alpha\\n */\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_LOC), p))\\n result :=\\n addmod(\\n result,\\n mulmod(\\n mload(C_ALPHA_BASE_LOC),\\n mulmod(\\n mload(L_END_LOC),\\n addmod(mload(Z_OMEGA_EVAL_LOC), sub(p, mload(PUBLIC_INPUT_DELTA_LOC)), p),\\n p\\n ),\\n p\\n ),\\n p\\n )\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_LOC), p))\\n mstore(\\n PERMUTATION_IDENTITY,\\n addmod(\\n result,\\n mulmod(\\n mload(C_ALPHA_BASE_LOC),\\n mulmod(mload(L_START_LOC), addmod(mload(Z_EVAL_LOC), sub(p, 1), p), p),\\n p\\n ),\\n p\\n )\\n )\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_LOC), p))\\n }\\n\\n /**\\n * COMPUTE PLOOKUP WIDGET EVALUATION\\n */\\n {\\n /**\\n * Goal: f = (w1(z) + q2.w1(z\\u03c9)) + \\u03b7(w2(z) + qm.w2(z\\u03c9)) + \\u03b7\\u00b2(w3(z) + qc.w_3(z\\u03c9)) + q3(z).\\u03b7\\u00b3\\n * f = \\u03b7.q3(z)\\n * f += (w3(z) + qc.w_3(z\\u03c9))\\n * f *= \\u03b7\\n * f += (w2(z) + qm.w2(z\\u03c9))\\n * f *= \\u03b7\\n * f += (w1(z) + q2.w1(z\\u03c9))\\n */\\n let f := mulmod(mload(C_ETA_LOC), mload(Q3_EVAL_LOC), p)\\n f :=\\n addmod(f, addmod(mload(W3_EVAL_LOC), mulmod(mload(QC_EVAL_LOC), mload(W3_OMEGA_EVAL_LOC), p), p), p)\\n f := mulmod(f, mload(C_ETA_LOC), p)\\n f :=\\n addmod(f, addmod(mload(W2_EVAL_LOC), mulmod(mload(QM_EVAL_LOC), mload(W2_OMEGA_EVAL_LOC), p), p), p)\\n f := mulmod(f, mload(C_ETA_LOC), p)\\n f :=\\n addmod(f, addmod(mload(W1_EVAL_LOC), mulmod(mload(Q2_EVAL_LOC), mload(W1_OMEGA_EVAL_LOC), p), p), p)\\n\\n // t(z) = table4(z).\\u03b7\\u00b3 + table3(z).\\u03b7\\u00b2 + table2(z).\\u03b7 + table1(z)\\n let t :=\\n addmod(\\n addmod(\\n addmod(\\n mulmod(mload(TABLE4_EVAL_LOC), mload(C_ETA_CUBE_LOC), p),\\n mulmod(mload(TABLE3_EVAL_LOC), mload(C_ETA_SQR_LOC), p),\\n p\\n ),\\n mulmod(mload(TABLE2_EVAL_LOC), mload(C_ETA_LOC), p),\\n p\\n ),\\n mload(TABLE1_EVAL_LOC),\\n p\\n )\\n\\n // t(zw) = table4(zw).\\u03b7\\u00b3 + table3(zw).\\u03b7\\u00b2 + table2(zw).\\u03b7 + table1(zw)\\n let t_omega :=\\n addmod(\\n addmod(\\n addmod(\\n mulmod(mload(TABLE4_OMEGA_EVAL_LOC), mload(C_ETA_CUBE_LOC), p),\\n mulmod(mload(TABLE3_OMEGA_EVAL_LOC), mload(C_ETA_SQR_LOC), p),\\n p\\n ),\\n mulmod(mload(TABLE2_OMEGA_EVAL_LOC), mload(C_ETA_LOC), p),\\n p\\n ),\\n mload(TABLE1_OMEGA_EVAL_LOC),\\n p\\n )\\n\\n /**\\n * Goal: numerator = (TABLE_TYPE_EVAL * f(z) + \\u03b3) * (t(z) + \\u03b2t(z\\u03c9) + \\u03b3(\\u03b2 + 1)) * (\\u03b2 + 1)\\n * gamma_beta_constant = \\u03b3(\\u03b2 + 1)\\n * numerator = f * TABLE_TYPE_EVAL + gamma\\n * temp0 = t(z) + t(z\\u03c9) * \\u03b2 + gamma_beta_constant\\n * numerator *= temp0\\n * numerator *= (\\u03b2 + 1)\\n * temp0 = alpha * l_1\\n * numerator += temp0\\n * numerator *= z_lookup(z)\\n * numerator -= temp0\\n */\\n let gamma_beta_constant := mulmod(mload(C_GAMMA_LOC), addmod(mload(C_BETA_LOC), 1, p), p)\\n let numerator := addmod(mulmod(f, mload(TABLE_TYPE_EVAL_LOC), p), mload(C_GAMMA_LOC), p)\\n let temp0 := addmod(addmod(t, mulmod(t_omega, mload(C_BETA_LOC), p), p), gamma_beta_constant, p)\\n numerator := mulmod(numerator, temp0, p)\\n numerator := mulmod(numerator, addmod(mload(C_BETA_LOC), 1, p), p)\\n temp0 := mulmod(mload(C_ALPHA_LOC), mload(L_START_LOC), p)\\n numerator := addmod(numerator, temp0, p)\\n numerator := mulmod(numerator, mload(Z_LOOKUP_EVAL_LOC), p)\\n numerator := addmod(numerator, sub(p, temp0), p)\\n\\n /**\\n * Goal: denominator = z_lookup(z\\u03c9)*[s(z) + \\u03b2s(z\\u03c9) + \\u03b3(1 + \\u03b2)] - [z_lookup(z\\u03c9) - [\\u03b3(1 + \\u03b2)]^{n-k}]*\\u03b1\\u00b2L_end(z)\\n * note: delta_factor = [\\u03b3(1 + \\u03b2)]^{n-k}\\n * denominator = s(z) + \\u03b2s(z\\u03c9) + \\u03b3(\\u03b2 + 1)\\n * temp1 = \\u03b1\\u00b2L_end(z)\\n * denominator -= temp1\\n * denominator *= z_lookup(z\\u03c9)\\n * denominator += temp1 * delta_factor\\n * PLOOKUP_IDENTITY = (numerator - denominator).alpha_base\\n * alpha_base *= alpha^3\\n */\\n let denominator :=\\n addmod(\\n addmod(mload(S_EVAL_LOC), mulmod(mload(S_OMEGA_EVAL_LOC), mload(C_BETA_LOC), p), p),\\n gamma_beta_constant,\\n p\\n )\\n let temp1 := mulmod(mload(C_ALPHA_SQR_LOC), mload(L_END_LOC), p)\\n denominator := addmod(denominator, sub(p, temp1), p)\\n denominator := mulmod(denominator, mload(Z_LOOKUP_OMEGA_EVAL_LOC), p)\\n denominator := addmod(denominator, mulmod(temp1, mload(PLOOKUP_DELTA_LOC), p), p)\\n\\n mstore(PLOOKUP_IDENTITY, mulmod(addmod(numerator, sub(p, denominator), p), mload(C_ALPHA_BASE_LOC), p))\\n\\n // update alpha\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_CUBE_LOC), p))\\n }\\n\\n /**\\n * COMPUTE ARITHMETIC WIDGET EVALUATION\\n */\\n {\\n /**\\n * The basic arithmetic gate identity in standard plonk is as follows.\\n * (w_1 . w_2 . q_m) + (w_1 . q_1) + (w_2 . q_2) + (w_3 . q_3) + (w_4 . q_4) + q_c = 0\\n * However, for Ultraplonk, we extend this to support \\\"passing\\\" wires between rows (shown without alpha scaling below):\\n * q_arith * ( ( (-1/2) * (q_arith - 3) * q_m * w_1 * w_2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c ) +\\n * (q_arith - 1)*( \\u03b1 * (q_arith - 2) * (w_1 + w_4 - w_1_omega + q_m) + w_4_omega) ) = 0\\n *\\n * This formula results in several cases depending on q_arith:\\n * 1. q_arith == 0: Arithmetic gate is completely disabled\\n *\\n * 2. q_arith == 1: Everything in the minigate on the right is disabled. The equation is just a standard plonk equation\\n * with extra wires: q_m * w_1 * w_2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c = 0\\n *\\n * 3. q_arith == 2: The (w_1 + w_4 - ...) term is disabled. THe equation is:\\n * (1/2) * q_m * w_1 * w_2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c + w_4_omega = 0\\n * It allows defining w_4 at next index (w_4_omega) in terms of current wire values\\n *\\n * 4. q_arith == 3: The product of w_1 and w_2 is disabled, but a mini addition gate is enabled. \\u03b1 allows us to split\\n * the equation into two:\\n *\\n * q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c + 2 * w_4_omega = 0\\n * and\\n * w_1 + w_4 - w_1_omega + q_m = 0 (we are reusing q_m here)\\n *\\n * 5. q_arith > 3: The product of w_1 and w_2 is scaled by (q_arith - 3), while the w_4_omega term is scaled by (q_arith - 1).\\n * The equation can be split into two:\\n *\\n * (q_arith - 3)* q_m * w_1 * w_ 2 + q_1 * w_1 + q_2 * w_2 + q_3 * w_3 + q_4 * w_4 + q_c + (q_arith - 1) * w_4_omega = 0\\n * and\\n * w_1 + w_4 - w_1_omega + q_m = 0\\n *\\n * The problem that q_m is used both in both equations can be dealt with by appropriately changing selector values at\\n * the next gate. Then we can treat (q_arith - 1) as a simulated q_6 selector and scale q_m to handle (q_arith - 3) at\\n * product.\\n */\\n\\n let w1q1 := mulmod(mload(W1_EVAL_LOC), mload(Q1_EVAL_LOC), p)\\n let w2q2 := mulmod(mload(W2_EVAL_LOC), mload(Q2_EVAL_LOC), p)\\n let w3q3 := mulmod(mload(W3_EVAL_LOC), mload(Q3_EVAL_LOC), p)\\n let w4q3 := mulmod(mload(W4_EVAL_LOC), mload(Q4_EVAL_LOC), p)\\n\\n // @todo - Add a explicit test that hits QARITH == 3\\n // w1w2qm := (w_1 . w_2 . q_m . (QARITH_EVAL_LOC - 3)) / 2\\n let w1w2qm :=\\n mulmod(\\n mulmod(\\n mulmod(mulmod(mload(W1_EVAL_LOC), mload(W2_EVAL_LOC), p), mload(QM_EVAL_LOC), p),\\n addmod(mload(QARITH_EVAL_LOC), sub(p, 3), p),\\n p\\n ),\\n NEGATIVE_INVERSE_OF_2_MODULO_P,\\n p\\n )\\n\\n // (w_1 . w_2 . q_m . (q_arith - 3)) / -2) + (w_1 . q_1) + (w_2 . q_2) + (w_3 . q_3) + (w_4 . q_4) + q_c\\n let identity :=\\n addmod(\\n mload(QC_EVAL_LOC), addmod(w4q3, addmod(w3q3, addmod(w2q2, addmod(w1q1, w1w2qm, p), p), p), p), p\\n )\\n\\n // if q_arith == 3 we evaluate an additional mini addition gate (on top of the regular one), where:\\n // w_1 + w_4 - w_1_omega + q_m = 0\\n // we use this gate to save an addition gate when adding or subtracting non-native field elements\\n // \\u03b1 * (q_arith - 2) * (w_1 + w_4 - w_1_omega + q_m)\\n let extra_small_addition_gate_identity :=\\n mulmod(\\n mload(C_ALPHA_LOC),\\n mulmod(\\n addmod(mload(QARITH_EVAL_LOC), sub(p, 2), p),\\n addmod(\\n mload(QM_EVAL_LOC),\\n addmod(\\n sub(p, mload(W1_OMEGA_EVAL_LOC)), addmod(mload(W1_EVAL_LOC), mload(W4_EVAL_LOC), p), p\\n ),\\n p\\n ),\\n p\\n ),\\n p\\n )\\n\\n // if q_arith == 2 OR q_arith == 3 we add the 4th wire of the NEXT gate into the arithmetic identity\\n // N.B. if q_arith > 2, this wire value will be scaled by (q_arith - 1) relative to the other gate wires!\\n // alpha_base * q_arith * (identity + (q_arith - 1) * (w_4_omega + extra_small_addition_gate_identity))\\n mstore(\\n ARITHMETIC_IDENTITY,\\n mulmod(\\n mload(C_ALPHA_BASE_LOC),\\n mulmod(\\n mload(QARITH_EVAL_LOC),\\n addmod(\\n identity,\\n mulmod(\\n addmod(mload(QARITH_EVAL_LOC), sub(p, 1), p),\\n addmod(mload(W4_OMEGA_EVAL_LOC), extra_small_addition_gate_identity, p),\\n p\\n ),\\n p\\n ),\\n p\\n ),\\n p\\n )\\n )\\n\\n // update alpha\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_SQR_LOC), p))\\n }\\n\\n /**\\n * COMPUTE GENPERMSORT WIDGET EVALUATION\\n */\\n {\\n /**\\n * D1 = (w2 - w1)\\n * D2 = (w3 - w2)\\n * D3 = (w4 - w3)\\n * D4 = (w1_omega - w4)\\n *\\n * \\u03b1_a = alpha_base\\n * \\u03b1_b = alpha_base * \\u03b1\\n * \\u03b1_c = alpha_base * \\u03b1^2\\n * \\u03b1_d = alpha_base * \\u03b1^3\\n *\\n * range_accumulator = (\\n * D1(D1 - 1)(D1 - 2)(D1 - 3).\\u03b1_a +\\n * D2(D2 - 1)(D2 - 2)(D2 - 3).\\u03b1_b +\\n * D3(D3 - 1)(D3 - 2)(D3 - 3).\\u03b1_c +\\n * D4(D4 - 1)(D4 - 2)(D4 - 3).\\u03b1_d +\\n * ) . q_sort\\n */\\n let minus_two := sub(p, 2)\\n let minus_three := sub(p, 3)\\n let d1 := addmod(mload(W2_EVAL_LOC), sub(p, mload(W1_EVAL_LOC)), p)\\n let d2 := addmod(mload(W3_EVAL_LOC), sub(p, mload(W2_EVAL_LOC)), p)\\n let d3 := addmod(mload(W4_EVAL_LOC), sub(p, mload(W3_EVAL_LOC)), p)\\n let d4 := addmod(mload(W1_OMEGA_EVAL_LOC), sub(p, mload(W4_EVAL_LOC)), p)\\n\\n let range_accumulator :=\\n mulmod(\\n mulmod(\\n mulmod(addmod(mulmod(d1, d1, p), sub(p, d1), p), addmod(d1, minus_two, p), p),\\n addmod(d1, minus_three, p),\\n p\\n ),\\n mload(C_ALPHA_BASE_LOC),\\n p\\n )\\n range_accumulator :=\\n addmod(\\n range_accumulator,\\n mulmod(\\n mulmod(\\n mulmod(addmod(mulmod(d2, d2, p), sub(p, d2), p), addmod(d2, minus_two, p), p),\\n addmod(d2, minus_three, p),\\n p\\n ),\\n mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_LOC), p),\\n p\\n ),\\n p\\n )\\n range_accumulator :=\\n addmod(\\n range_accumulator,\\n mulmod(\\n mulmod(\\n mulmod(addmod(mulmod(d3, d3, p), sub(p, d3), p), addmod(d3, minus_two, p), p),\\n addmod(d3, minus_three, p),\\n p\\n ),\\n mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_SQR_LOC), p),\\n p\\n ),\\n p\\n )\\n range_accumulator :=\\n addmod(\\n range_accumulator,\\n mulmod(\\n mulmod(\\n mulmod(addmod(mulmod(d4, d4, p), sub(p, d4), p), addmod(d4, minus_two, p), p),\\n addmod(d4, minus_three, p),\\n p\\n ),\\n mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_CUBE_LOC), p),\\n p\\n ),\\n p\\n )\\n range_accumulator := mulmod(range_accumulator, mload(QSORT_EVAL_LOC), p)\\n\\n mstore(SORT_IDENTITY, range_accumulator)\\n\\n // update alpha\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_QUAD_LOC), p))\\n }\\n\\n /**\\n * COMPUTE ELLIPTIC WIDGET EVALUATION\\n */\\n {\\n /**\\n * endo_term = (-x_2) * x_1 * (x_3 * 2 + x_1) * q_beta\\n * endo_sqr_term = x_2^2\\n * endo_sqr_term *= (x_3 - x_1)\\n * endo_sqr_term *= q_beta^2\\n * leftovers = x_2^2\\n * leftovers *= x_2\\n * leftovers += x_1^2 * (x_3 + x_1) @follow-up Invalid comment in BB widget\\n * leftovers -= (y_2^2 + y_1^2)\\n * sign_term = y_2 * y_1\\n * sign_term += sign_term\\n * sign_term *= q_sign\\n */\\n // q_elliptic * (x3 + x2 + x1)(x2 - x1)(x2 - x1) - y2^2 - y1^2 + 2(y2y1)*q_sign = 0\\n let x_diff := addmod(mload(X2_EVAL_LOC), sub(p, mload(X1_EVAL_LOC)), p)\\n let y2_sqr := mulmod(mload(Y2_EVAL_LOC), mload(Y2_EVAL_LOC), p)\\n let y1_sqr := mulmod(mload(Y1_EVAL_LOC), mload(Y1_EVAL_LOC), p)\\n let y1y2 := mulmod(mulmod(mload(Y1_EVAL_LOC), mload(Y2_EVAL_LOC), p), mload(QSIGN_LOC), p)\\n\\n let x_add_identity :=\\n addmod(\\n mulmod(\\n addmod(mload(X3_EVAL_LOC), addmod(mload(X2_EVAL_LOC), mload(X1_EVAL_LOC), p), p),\\n mulmod(x_diff, x_diff, p),\\n p\\n ),\\n addmod(\\n sub(\\n p,\\n addmod(y2_sqr, y1_sqr, p)\\n ),\\n addmod(y1y2, y1y2, p),\\n p\\n ),\\n p\\n )\\n x_add_identity :=\\n mulmod(\\n mulmod(\\n x_add_identity,\\n addmod(\\n 1,\\n sub(p, mload(QM_EVAL_LOC)),\\n p\\n ),\\n p\\n ),\\n mload(C_ALPHA_BASE_LOC),\\n p\\n )\\n\\n // q_elliptic * (x3 + x2 + x1)(x2 - x1)(x2 - x1) - y2^2 - y1^2 + 2(y2y1)*q_sign = 0\\n let y1_plus_y3 := addmod(\\n mload(Y1_EVAL_LOC),\\n mload(Y3_EVAL_LOC),\\n p\\n )\\n let y_diff := addmod(mulmod(mload(Y2_EVAL_LOC), mload(QSIGN_LOC), p), sub(p, mload(Y1_EVAL_LOC)), p)\\n let y_add_identity :=\\n addmod(\\n mulmod(y1_plus_y3, x_diff, p),\\n mulmod(addmod(mload(X3_EVAL_LOC), sub(p, mload(X1_EVAL_LOC)), p), y_diff, p),\\n p\\n )\\n y_add_identity :=\\n mulmod(\\n mulmod(y_add_identity, addmod(1, sub(p, mload(QM_EVAL_LOC)), p), p),\\n mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_LOC), p),\\n p\\n )\\n\\n // ELLIPTIC_IDENTITY = (x_identity + y_identity) * Q_ELLIPTIC_EVAL\\n mstore(\\n ELLIPTIC_IDENTITY, mulmod(addmod(x_add_identity, y_add_identity, p), mload(QELLIPTIC_EVAL_LOC), p)\\n )\\n }\\n {\\n /**\\n * x_pow_4 = (y_1_sqr - curve_b) * x_1;\\n * y_1_sqr_mul_4 = y_1_sqr + y_1_sqr;\\n * y_1_sqr_mul_4 += y_1_sqr_mul_4;\\n * x_1_pow_4_mul_9 = x_pow_4;\\n * x_1_pow_4_mul_9 += x_1_pow_4_mul_9;\\n * x_1_pow_4_mul_9 += x_1_pow_4_mul_9;\\n * x_1_pow_4_mul_9 += x_1_pow_4_mul_9;\\n * x_1_pow_4_mul_9 += x_pow_4;\\n * x_1_sqr_mul_3 = x_1_sqr + x_1_sqr + x_1_sqr;\\n * x_double_identity = (x_3 + x_1 + x_1) * y_1_sqr_mul_4 - x_1_pow_4_mul_9;\\n * y_double_identity = x_1_sqr_mul_3 * (x_1 - x_3) - (y_1 + y_1) * (y_1 + y_3);\\n */\\n // (x3 + x1 + x1) (4y1*y1) - 9 * x1 * x1 * x1 * x1 = 0\\n let x1_sqr := mulmod(mload(X1_EVAL_LOC), mload(X1_EVAL_LOC), p)\\n let y1_sqr := mulmod(mload(Y1_EVAL_LOC), mload(Y1_EVAL_LOC), p)\\n let x_pow_4 := mulmod(addmod(y1_sqr, GRUMPKIN_CURVE_B_PARAMETER_NEGATED, p), mload(X1_EVAL_LOC), p)\\n let y1_sqr_mul_4 := mulmod(y1_sqr, 4, p)\\n let x1_pow_4_mul_9 := mulmod(x_pow_4, 9, p)\\n let x1_sqr_mul_3 := mulmod(x1_sqr, 3, p)\\n let x_double_identity :=\\n addmod(\\n mulmod(\\n addmod(mload(X3_EVAL_LOC), addmod(mload(X1_EVAL_LOC), mload(X1_EVAL_LOC), p), p),\\n y1_sqr_mul_4,\\n p\\n ),\\n sub(p, x1_pow_4_mul_9),\\n p\\n )\\n // (y1 + y1) (2y1) - (3 * x1 * x1)(x1 - x3) = 0\\n let y_double_identity :=\\n addmod(\\n mulmod(x1_sqr_mul_3, addmod(mload(X1_EVAL_LOC), sub(p, mload(X3_EVAL_LOC)), p), p),\\n sub(\\n p,\\n mulmod(\\n addmod(mload(Y1_EVAL_LOC), mload(Y1_EVAL_LOC), p),\\n addmod(mload(Y1_EVAL_LOC), mload(Y3_EVAL_LOC), p),\\n p\\n )\\n ),\\n p\\n )\\n x_double_identity := mulmod(x_double_identity, mload(C_ALPHA_BASE_LOC), p)\\n y_double_identity :=\\n mulmod(y_double_identity, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_LOC), p), p)\\n x_double_identity := mulmod(x_double_identity, mload(QM_EVAL_LOC), p)\\n y_double_identity := mulmod(y_double_identity, mload(QM_EVAL_LOC), p)\\n // ELLIPTIC_IDENTITY += (x_double_identity + y_double_identity) * Q_DOUBLE_EVAL\\n mstore(\\n ELLIPTIC_IDENTITY,\\n addmod(\\n mload(ELLIPTIC_IDENTITY),\\n mulmod(addmod(x_double_identity, y_double_identity, p), mload(QELLIPTIC_EVAL_LOC), p),\\n p\\n )\\n )\\n\\n // update alpha\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_QUAD_LOC), p))\\n }\\n\\n /**\\n * COMPUTE AUXILIARY WIDGET EVALUATION\\n */\\n {\\n {\\n /**\\n * Non native field arithmetic gate 2\\n * _ _\\n * / _ _ _ 14 \\\\\\n * q_2 . q_4 | (w_1 . w_2) + (w_1 . w_2) + (w_1 . w_4 + w_2 . w_3 - w_3) . 2 - w_3 - w_4 |\\n * \\\\_ _/\\n *\\n * limb_subproduct = w_1 . w_2_omega + w_1_omega . w_2\\n * non_native_field_gate_2 = w_1 * w_4 + w_4 * w_3 - w_3_omega\\n * non_native_field_gate_2 = non_native_field_gate_2 * limb_size\\n * non_native_field_gate_2 -= w_4_omega\\n * non_native_field_gate_2 += limb_subproduct\\n * non_native_field_gate_2 *= q_4\\n * limb_subproduct *= limb_size\\n * limb_subproduct += w_1_omega * w_2_omega\\n * non_native_field_gate_1 = (limb_subproduct + w_3 + w_4) * q_3\\n * non_native_field_gate_3 = (limb_subproduct + w_4 - (w_3_omega + w_4_omega)) * q_m\\n * non_native_field_identity = (non_native_field_gate_1 + non_native_field_gate_2 + non_native_field_gate_3) * q_2\\n */\\n\\n let limb_subproduct :=\\n addmod(\\n mulmod(mload(W1_EVAL_LOC), mload(W2_OMEGA_EVAL_LOC), p),\\n mulmod(mload(W1_OMEGA_EVAL_LOC), mload(W2_EVAL_LOC), p),\\n p\\n )\\n\\n let non_native_field_gate_2 :=\\n addmod(\\n addmod(\\n mulmod(mload(W1_EVAL_LOC), mload(W4_EVAL_LOC), p),\\n mulmod(mload(W2_EVAL_LOC), mload(W3_EVAL_LOC), p),\\n p\\n ),\\n sub(p, mload(W3_OMEGA_EVAL_LOC)),\\n p\\n )\\n non_native_field_gate_2 := mulmod(non_native_field_gate_2, LIMB_SIZE, p)\\n non_native_field_gate_2 := addmod(non_native_field_gate_2, sub(p, mload(W4_OMEGA_EVAL_LOC)), p)\\n non_native_field_gate_2 := addmod(non_native_field_gate_2, limb_subproduct, p)\\n non_native_field_gate_2 := mulmod(non_native_field_gate_2, mload(Q4_EVAL_LOC), p)\\n limb_subproduct := mulmod(limb_subproduct, LIMB_SIZE, p)\\n limb_subproduct :=\\n addmod(limb_subproduct, mulmod(mload(W1_OMEGA_EVAL_LOC), mload(W2_OMEGA_EVAL_LOC), p), p)\\n let non_native_field_gate_1 :=\\n mulmod(\\n addmod(limb_subproduct, sub(p, addmod(mload(W3_EVAL_LOC), mload(W4_EVAL_LOC), p)), p),\\n mload(Q3_EVAL_LOC),\\n p\\n )\\n let non_native_field_gate_3 :=\\n mulmod(\\n addmod(\\n addmod(limb_subproduct, mload(W4_EVAL_LOC), p),\\n sub(p, addmod(mload(W3_OMEGA_EVAL_LOC), mload(W4_OMEGA_EVAL_LOC), p)),\\n p\\n ),\\n mload(QM_EVAL_LOC),\\n p\\n )\\n let non_native_field_identity :=\\n mulmod(\\n addmod(addmod(non_native_field_gate_1, non_native_field_gate_2, p), non_native_field_gate_3, p),\\n mload(Q2_EVAL_LOC),\\n p\\n )\\n\\n mstore(AUX_NON_NATIVE_FIELD_EVALUATION, non_native_field_identity)\\n }\\n\\n {\\n /**\\n * limb_accumulator_1 = w_2_omega;\\n * limb_accumulator_1 *= SUBLIMB_SHIFT;\\n * limb_accumulator_1 += w_1_omega;\\n * limb_accumulator_1 *= SUBLIMB_SHIFT;\\n * limb_accumulator_1 += w_3;\\n * limb_accumulator_1 *= SUBLIMB_SHIFT;\\n * limb_accumulator_1 += w_2;\\n * limb_accumulator_1 *= SUBLIMB_SHIFT;\\n * limb_accumulator_1 += w_1;\\n * limb_accumulator_1 -= w_4;\\n * limb_accumulator_1 *= q_4;\\n */\\n let limb_accumulator_1 := mulmod(mload(W2_OMEGA_EVAL_LOC), SUBLIMB_SHIFT, p)\\n limb_accumulator_1 := addmod(limb_accumulator_1, mload(W1_OMEGA_EVAL_LOC), p)\\n limb_accumulator_1 := mulmod(limb_accumulator_1, SUBLIMB_SHIFT, p)\\n limb_accumulator_1 := addmod(limb_accumulator_1, mload(W3_EVAL_LOC), p)\\n limb_accumulator_1 := mulmod(limb_accumulator_1, SUBLIMB_SHIFT, p)\\n limb_accumulator_1 := addmod(limb_accumulator_1, mload(W2_EVAL_LOC), p)\\n limb_accumulator_1 := mulmod(limb_accumulator_1, SUBLIMB_SHIFT, p)\\n limb_accumulator_1 := addmod(limb_accumulator_1, mload(W1_EVAL_LOC), p)\\n limb_accumulator_1 := addmod(limb_accumulator_1, sub(p, mload(W4_EVAL_LOC)), p)\\n limb_accumulator_1 := mulmod(limb_accumulator_1, mload(Q4_EVAL_LOC), p)\\n\\n /**\\n * limb_accumulator_2 = w_3_omega;\\n * limb_accumulator_2 *= SUBLIMB_SHIFT;\\n * limb_accumulator_2 += w_2_omega;\\n * limb_accumulator_2 *= SUBLIMB_SHIFT;\\n * limb_accumulator_2 += w_1_omega;\\n * limb_accumulator_2 *= SUBLIMB_SHIFT;\\n * limb_accumulator_2 += w_4;\\n * limb_accumulator_2 *= SUBLIMB_SHIFT;\\n * limb_accumulator_2 += w_3;\\n * limb_accumulator_2 -= w_4_omega;\\n * limb_accumulator_2 *= q_m;\\n */\\n let limb_accumulator_2 := mulmod(mload(W3_OMEGA_EVAL_LOC), SUBLIMB_SHIFT, p)\\n limb_accumulator_2 := addmod(limb_accumulator_2, mload(W2_OMEGA_EVAL_LOC), p)\\n limb_accumulator_2 := mulmod(limb_accumulator_2, SUBLIMB_SHIFT, p)\\n limb_accumulator_2 := addmod(limb_accumulator_2, mload(W1_OMEGA_EVAL_LOC), p)\\n limb_accumulator_2 := mulmod(limb_accumulator_2, SUBLIMB_SHIFT, p)\\n limb_accumulator_2 := addmod(limb_accumulator_2, mload(W4_EVAL_LOC), p)\\n limb_accumulator_2 := mulmod(limb_accumulator_2, SUBLIMB_SHIFT, p)\\n limb_accumulator_2 := addmod(limb_accumulator_2, mload(W3_EVAL_LOC), p)\\n limb_accumulator_2 := addmod(limb_accumulator_2, sub(p, mload(W4_OMEGA_EVAL_LOC)), p)\\n limb_accumulator_2 := mulmod(limb_accumulator_2, mload(QM_EVAL_LOC), p)\\n\\n mstore(\\n AUX_LIMB_ACCUMULATOR_EVALUATION,\\n mulmod(addmod(limb_accumulator_1, limb_accumulator_2, p), mload(Q3_EVAL_LOC), p)\\n )\\n }\\n\\n {\\n /**\\n * memory_record_check = w_3;\\n * memory_record_check *= eta;\\n * memory_record_check += w_2;\\n * memory_record_check *= eta;\\n * memory_record_check += w_1;\\n * memory_record_check *= eta;\\n * memory_record_check += q_c;\\n *\\n * partial_record_check = memory_record_check;\\n *\\n * memory_record_check -= w_4;\\n */\\n\\n let memory_record_check := mulmod(mload(W3_EVAL_LOC), mload(C_ETA_LOC), p)\\n memory_record_check := addmod(memory_record_check, mload(W2_EVAL_LOC), p)\\n memory_record_check := mulmod(memory_record_check, mload(C_ETA_LOC), p)\\n memory_record_check := addmod(memory_record_check, mload(W1_EVAL_LOC), p)\\n memory_record_check := mulmod(memory_record_check, mload(C_ETA_LOC), p)\\n memory_record_check := addmod(memory_record_check, mload(QC_EVAL_LOC), p)\\n\\n let partial_record_check := memory_record_check\\n memory_record_check := addmod(memory_record_check, sub(p, mload(W4_EVAL_LOC)), p)\\n\\n mstore(AUX_MEMORY_EVALUATION, memory_record_check)\\n\\n // index_delta = w_1_omega - w_1\\n let index_delta := addmod(mload(W1_OMEGA_EVAL_LOC), sub(p, mload(W1_EVAL_LOC)), p)\\n // record_delta = w_4_omega - w_4\\n let record_delta := addmod(mload(W4_OMEGA_EVAL_LOC), sub(p, mload(W4_EVAL_LOC)), p)\\n // index_is_monotonically_increasing = index_delta * (index_delta - 1)\\n let index_is_monotonically_increasing := mulmod(index_delta, addmod(index_delta, sub(p, 1), p), p)\\n\\n // adjacent_values_match_if_adjacent_indices_match = record_delta * (1 - index_delta)\\n let adjacent_values_match_if_adjacent_indices_match :=\\n mulmod(record_delta, addmod(1, sub(p, index_delta), p), p)\\n\\n // AUX_ROM_CONSISTENCY_EVALUATION = ((adjacent_values_match_if_adjacent_indices_match * alpha) + index_is_monotonically_increasing) * alpha + partial_record_check\\n mstore(\\n AUX_ROM_CONSISTENCY_EVALUATION,\\n addmod(\\n mulmod(\\n addmod(\\n mulmod(adjacent_values_match_if_adjacent_indices_match, mload(C_ALPHA_LOC), p),\\n index_is_monotonically_increasing,\\n p\\n ),\\n mload(C_ALPHA_LOC),\\n p\\n ),\\n memory_record_check,\\n p\\n )\\n )\\n\\n {\\n /**\\n * next_gate_access_type = w_3_omega;\\n * next_gate_access_type *= eta;\\n * next_gate_access_type += w_2_omega;\\n * next_gate_access_type *= eta;\\n * next_gate_access_type += w_1_omega;\\n * next_gate_access_type *= eta;\\n * next_gate_access_type = w_4_omega - next_gate_access_type;\\n */\\n let next_gate_access_type := mulmod(mload(W3_OMEGA_EVAL_LOC), mload(C_ETA_LOC), p)\\n next_gate_access_type := addmod(next_gate_access_type, mload(W2_OMEGA_EVAL_LOC), p)\\n next_gate_access_type := mulmod(next_gate_access_type, mload(C_ETA_LOC), p)\\n next_gate_access_type := addmod(next_gate_access_type, mload(W1_OMEGA_EVAL_LOC), p)\\n next_gate_access_type := mulmod(next_gate_access_type, mload(C_ETA_LOC), p)\\n next_gate_access_type := addmod(mload(W4_OMEGA_EVAL_LOC), sub(p, next_gate_access_type), p)\\n\\n // value_delta = w_3_omega - w_3\\n let value_delta := addmod(mload(W3_OMEGA_EVAL_LOC), sub(p, mload(W3_EVAL_LOC)), p)\\n // adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation = (1 - index_delta) * value_delta * (1 - next_gate_access_type);\\n\\n let adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation :=\\n mulmod(\\n addmod(1, sub(p, index_delta), p),\\n mulmod(value_delta, addmod(1, sub(p, next_gate_access_type), p), p),\\n p\\n )\\n\\n // AUX_RAM_CONSISTENCY_EVALUATION\\n\\n /**\\n * access_type = w_4 - partial_record_check\\n * access_check = access_type^2 - access_type\\n * next_gate_access_type_is_boolean = next_gate_access_type^2 - next_gate_access_type\\n * RAM_consistency_check_identity = adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation;\\n * RAM_consistency_check_identity *= alpha;\\n * RAM_consistency_check_identity += index_is_monotonically_increasing;\\n * RAM_consistency_check_identity *= alpha;\\n * RAM_consistency_check_identity += next_gate_access_type_is_boolean;\\n * RAM_consistency_check_identity *= alpha;\\n * RAM_consistency_check_identity += access_check;\\n */\\n\\n let access_type := addmod(mload(W4_EVAL_LOC), sub(p, partial_record_check), p)\\n let access_check := mulmod(access_type, addmod(access_type, sub(p, 1), p), p)\\n let next_gate_access_type_is_boolean :=\\n mulmod(next_gate_access_type, addmod(next_gate_access_type, sub(p, 1), p), p)\\n let RAM_cci :=\\n mulmod(\\n adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation,\\n mload(C_ALPHA_LOC),\\n p\\n )\\n RAM_cci := addmod(RAM_cci, index_is_monotonically_increasing, p)\\n RAM_cci := mulmod(RAM_cci, mload(C_ALPHA_LOC), p)\\n RAM_cci := addmod(RAM_cci, next_gate_access_type_is_boolean, p)\\n RAM_cci := mulmod(RAM_cci, mload(C_ALPHA_LOC), p)\\n RAM_cci := addmod(RAM_cci, access_check, p)\\n\\n mstore(AUX_RAM_CONSISTENCY_EVALUATION, RAM_cci)\\n }\\n\\n {\\n // timestamp_delta = w_2_omega - w_2\\n let timestamp_delta := addmod(mload(W2_OMEGA_EVAL_LOC), sub(p, mload(W2_EVAL_LOC)), p)\\n\\n // RAM_timestamp_check_identity = (1 - index_delta) * timestamp_delta - w_3\\n let RAM_timestamp_check_identity :=\\n addmod(\\n mulmod(timestamp_delta, addmod(1, sub(p, index_delta), p), p), sub(p, mload(W3_EVAL_LOC)), p\\n )\\n\\n /**\\n * memory_identity = ROM_consistency_check_identity * q_2;\\n * memory_identity += RAM_timestamp_check_identity * q_4;\\n * memory_identity += memory_record_check * q_m;\\n * memory_identity *= q_1;\\n * memory_identity += (RAM_consistency_check_identity * q_arith);\\n *\\n * auxiliary_identity = memory_identity + non_native_field_identity + limb_accumulator_identity;\\n * auxiliary_identity *= q_aux;\\n * auxiliary_identity *= alpha_base;\\n */\\n let memory_identity := mulmod(mload(AUX_ROM_CONSISTENCY_EVALUATION), mload(Q2_EVAL_LOC), p)\\n memory_identity :=\\n addmod(memory_identity, mulmod(RAM_timestamp_check_identity, mload(Q4_EVAL_LOC), p), p)\\n memory_identity :=\\n addmod(memory_identity, mulmod(mload(AUX_MEMORY_EVALUATION), mload(QM_EVAL_LOC), p), p)\\n memory_identity := mulmod(memory_identity, mload(Q1_EVAL_LOC), p)\\n memory_identity :=\\n addmod(\\n memory_identity, mulmod(mload(AUX_RAM_CONSISTENCY_EVALUATION), mload(QARITH_EVAL_LOC), p), p\\n )\\n\\n let auxiliary_identity := addmod(memory_identity, mload(AUX_NON_NATIVE_FIELD_EVALUATION), p)\\n auxiliary_identity := addmod(auxiliary_identity, mload(AUX_LIMB_ACCUMULATOR_EVALUATION), p)\\n auxiliary_identity := mulmod(auxiliary_identity, mload(QAUX_EVAL_LOC), p)\\n auxiliary_identity := mulmod(auxiliary_identity, mload(C_ALPHA_BASE_LOC), p)\\n\\n mstore(AUX_IDENTITY, auxiliary_identity)\\n\\n // update alpha\\n mstore(C_ALPHA_BASE_LOC, mulmod(mload(C_ALPHA_BASE_LOC), mload(C_ALPHA_CUBE_LOC), p))\\n }\\n }\\n }\\n\\n {\\n /**\\n * quotient = ARITHMETIC_IDENTITY\\n * quotient += PERMUTATION_IDENTITY\\n * quotient += PLOOKUP_IDENTITY\\n * quotient += SORT_IDENTITY\\n * quotient += ELLIPTIC_IDENTITY\\n * quotient += AUX_IDENTITY\\n * quotient *= ZERO_POLY_INVERSE\\n */\\n mstore(\\n QUOTIENT_EVAL_LOC,\\n mulmod(\\n addmod(\\n addmod(\\n addmod(\\n addmod(\\n addmod(mload(PERMUTATION_IDENTITY), mload(PLOOKUP_IDENTITY), p),\\n mload(ARITHMETIC_IDENTITY),\\n p\\n ),\\n mload(SORT_IDENTITY),\\n p\\n ),\\n mload(ELLIPTIC_IDENTITY),\\n p\\n ),\\n mload(AUX_IDENTITY),\\n p\\n ),\\n mload(ZERO_POLY_INVERSE_LOC),\\n p\\n )\\n )\\n }\\n\\n /**\\n * GENERATE NU AND SEPARATOR CHALLENGES\\n */\\n {\\n let current_challenge := mload(C_CURRENT_LOC)\\n // get a calldata pointer that points to the start of the data we want to copy\\n let calldata_ptr := add(calldataload(0x04), 0x24)\\n\\n calldata_ptr := add(calldata_ptr, NU_CALLDATA_SKIP_LENGTH)\\n\\n mstore(NU_CHALLENGE_INPUT_LOC_A, current_challenge)\\n mstore(NU_CHALLENGE_INPUT_LOC_B, mload(QUOTIENT_EVAL_LOC))\\n calldatacopy(NU_CHALLENGE_INPUT_LOC_C, calldata_ptr, NU_INPUT_LENGTH)\\n\\n // hash length = (0x20 + num field elements), we include the previous challenge in the hash\\n let challenge := keccak256(NU_CHALLENGE_INPUT_LOC_A, add(NU_INPUT_LENGTH, 0x40))\\n\\n mstore(C_V0_LOC, mod(challenge, p))\\n // We need THIRTY-ONE independent nu challenges!\\n mstore(0x00, challenge)\\n mstore8(0x20, 0x01)\\n mstore(C_V1_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x02)\\n mstore(C_V2_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x03)\\n mstore(C_V3_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x04)\\n mstore(C_V4_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x05)\\n mstore(C_V5_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x06)\\n mstore(C_V6_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x07)\\n mstore(C_V7_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x08)\\n mstore(C_V8_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x09)\\n mstore(C_V9_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x0a)\\n mstore(C_V10_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x0b)\\n mstore(C_V11_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x0c)\\n mstore(C_V12_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x0d)\\n mstore(C_V13_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x0e)\\n mstore(C_V14_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x0f)\\n mstore(C_V15_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x10)\\n mstore(C_V16_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x11)\\n mstore(C_V17_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x12)\\n mstore(C_V18_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x13)\\n mstore(C_V19_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x14)\\n mstore(C_V20_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x15)\\n mstore(C_V21_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x16)\\n mstore(C_V22_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x17)\\n mstore(C_V23_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x18)\\n mstore(C_V24_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x19)\\n mstore(C_V25_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x1a)\\n mstore(C_V26_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x1b)\\n mstore(C_V27_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x1c)\\n mstore(C_V28_LOC, mod(keccak256(0x00, 0x21), p))\\n mstore8(0x20, 0x1d)\\n mstore(C_V29_LOC, mod(keccak256(0x00, 0x21), p))\\n\\n // @follow-up - Why are both v29 and v30 using appending 0x1d to the prior challenge and hashing, should it not change?\\n mstore8(0x20, 0x1d)\\n challenge := keccak256(0x00, 0x21)\\n mstore(C_V30_LOC, mod(challenge, p))\\n\\n // separator\\n mstore(0x00, challenge)\\n mstore(0x20, mload(PI_Z_Y_LOC))\\n mstore(0x40, mload(PI_Z_X_LOC))\\n mstore(0x60, mload(PI_Z_OMEGA_Y_LOC))\\n mstore(0x80, mload(PI_Z_OMEGA_X_LOC))\\n\\n mstore(C_U_LOC, mod(keccak256(0x00, 0xa0), p))\\n }\\n\\n let success := 0\\n // VALIDATE T1\\n {\\n let x := mload(T1_X_LOC)\\n let y := mload(T1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(ACCUMULATOR_X_LOC, x)\\n mstore(add(ACCUMULATOR_X_LOC, 0x20), y)\\n }\\n // VALIDATE T2\\n {\\n let x := mload(T2_X_LOC) // 0x1400\\n let y := mload(T2_Y_LOC) // 0x1420\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mload(ZETA_POW_N_LOC))\\n // accumulator_2 = [T2].zeta^n\\n success := staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40)\\n // accumulator = [T1] + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE T3\\n {\\n let x := mload(T3_X_LOC)\\n let y := mload(T3_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(mload(ZETA_POW_N_LOC), mload(ZETA_POW_N_LOC), p))\\n // accumulator_2 = [T3].zeta^{2n}\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE T4\\n {\\n let x := mload(T4_X_LOC)\\n let y := mload(T4_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(mulmod(mload(ZETA_POW_N_LOC), mload(ZETA_POW_N_LOC), p), mload(ZETA_POW_N_LOC), p))\\n // accumulator_2 = [T4].zeta^{3n}\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE W1\\n {\\n let x := mload(W1_X_LOC)\\n let y := mload(W1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V0_LOC), p))\\n // accumulator_2 = v0.(u + 1).[W1]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE W2\\n {\\n let x := mload(W2_X_LOC)\\n let y := mload(W2_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V1_LOC), p))\\n // accumulator_2 = v1.(u + 1).[W2]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE W3\\n {\\n let x := mload(W3_X_LOC)\\n let y := mload(W3_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V2_LOC), p))\\n // accumulator_2 = v2.(u + 1).[W3]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE W4\\n {\\n let x := mload(W4_X_LOC)\\n let y := mload(W4_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V3_LOC), p))\\n // accumulator_2 = v3.(u + 1).[W4]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE S\\n {\\n let x := mload(S_X_LOC)\\n let y := mload(S_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V4_LOC), p))\\n // accumulator_2 = v4.(u + 1).[S]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE Z\\n {\\n let x := mload(Z_X_LOC)\\n let y := mload(Z_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V5_LOC), p))\\n // accumulator_2 = v5.(u + 1).[Z]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE Z_LOOKUP\\n {\\n let x := mload(Z_LOOKUP_X_LOC)\\n let y := mload(Z_LOOKUP_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V6_LOC), p))\\n // accumulator_2 = v6.(u + 1).[Z_LOOKUP]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE Q1\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(Q1_X_LOC))\\n mstore(0x20, mload(Q1_Y_LOC))\\n mstore(0x40, mload(C_V7_LOC))\\n // accumulator_2 = v7.[Q1]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE Q2\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(Q2_X_LOC))\\n mstore(0x20, mload(Q2_Y_LOC))\\n mstore(0x40, mload(C_V8_LOC))\\n // accumulator_2 = v8.[Q2]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE Q3\\n \\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(Q3_X_LOC))\\n mstore(0x20, mload(Q3_Y_LOC))\\n mstore(0x40, mload(C_V9_LOC))\\n // accumulator_2 = v9.[Q3]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE Q4\\n \\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(Q4_X_LOC))\\n mstore(0x20, mload(Q4_Y_LOC))\\n mstore(0x40, mload(C_V10_LOC))\\n // accumulator_2 = v10.[Q4]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE QM\\n \\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(QM_X_LOC))\\n mstore(0x20, mload(QM_Y_LOC))\\n mstore(0x40, mload(C_V11_LOC))\\n // accumulator_2 = v11.[Q;]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE QC\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(QC_X_LOC))\\n mstore(0x20, mload(QC_Y_LOC))\\n mstore(0x40, mload(C_V12_LOC))\\n // accumulator_2 = v12.[QC]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE QARITH\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(QARITH_X_LOC))\\n mstore(0x20, mload(QARITH_Y_LOC))\\n mstore(0x40, mload(C_V13_LOC))\\n // accumulator_2 = v13.[QARITH]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE QSORT\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(QSORT_X_LOC))\\n mstore(0x20, mload(QSORT_Y_LOC))\\n mstore(0x40, mload(C_V14_LOC))\\n // accumulator_2 = v14.[QSORT]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE QELLIPTIC\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(QELLIPTIC_X_LOC))\\n mstore(0x20, mload(QELLIPTIC_Y_LOC))\\n mstore(0x40, mload(C_V15_LOC))\\n // accumulator_2 = v15.[QELLIPTIC]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE QAUX\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(QAUX_X_LOC))\\n mstore(0x20, mload(QAUX_Y_LOC))\\n mstore(0x40, mload(C_V16_LOC))\\n // accumulator_2 = v15.[Q_AUX]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE SIGMA1\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(SIGMA1_X_LOC))\\n mstore(0x20, mload(SIGMA1_Y_LOC))\\n mstore(0x40, mload(C_V17_LOC))\\n // accumulator_2 = v17.[sigma1]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE SIGMA2\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(SIGMA2_X_LOC))\\n mstore(0x20, mload(SIGMA2_Y_LOC))\\n mstore(0x40, mload(C_V18_LOC))\\n // accumulator_2 = v18.[sigma2]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE SIGMA3\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(SIGMA3_X_LOC))\\n mstore(0x20, mload(SIGMA3_Y_LOC))\\n mstore(0x40, mload(C_V19_LOC))\\n // accumulator_2 = v19.[sigma3]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE SIGMA4\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(SIGMA4_X_LOC))\\n mstore(0x20, mload(SIGMA4_Y_LOC))\\n mstore(0x40, mload(C_V20_LOC))\\n // accumulator_2 = v20.[sigma4]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE TABLE1\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(TABLE1_X_LOC))\\n mstore(0x20, mload(TABLE1_Y_LOC))\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V21_LOC), p))\\n // accumulator_2 = u.[table1]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE TABLE2\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(TABLE2_X_LOC))\\n mstore(0x20, mload(TABLE2_Y_LOC))\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V22_LOC), p))\\n // accumulator_2 = u.[table2]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE TABLE3\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(TABLE3_X_LOC))\\n mstore(0x20, mload(TABLE3_Y_LOC))\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V23_LOC), p))\\n // accumulator_2 = u.[table3]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE TABLE4\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(TABLE4_X_LOC))\\n mstore(0x20, mload(TABLE4_Y_LOC))\\n mstore(0x40, mulmod(addmod(mload(C_U_LOC), 0x1, p), mload(C_V24_LOC), p))\\n // accumulator_2 = u.[table4]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE TABLE_TYPE\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(TABLE_TYPE_X_LOC))\\n mstore(0x20, mload(TABLE_TYPE_Y_LOC))\\n mstore(0x40, mload(C_V25_LOC))\\n // accumulator_2 = v25.[TableType]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE ID1\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(ID1_X_LOC))\\n mstore(0x20, mload(ID1_Y_LOC))\\n mstore(0x40, mload(C_V26_LOC))\\n // accumulator_2 = v26.[ID1]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE ID2\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(ID2_X_LOC))\\n mstore(0x20, mload(ID2_Y_LOC))\\n mstore(0x40, mload(C_V27_LOC))\\n // accumulator_2 = v27.[ID2]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE ID3\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(ID3_X_LOC))\\n mstore(0x20, mload(ID3_Y_LOC))\\n mstore(0x40, mload(C_V28_LOC))\\n // accumulator_2 = v28.[ID3]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // ACCUMULATE ID4\\n\\n // Verification key fields verified to be on curve at contract deployment\\n mstore(0x00, mload(ID4_X_LOC))\\n mstore(0x20, mload(ID4_Y_LOC))\\n mstore(0x40, mload(C_V29_LOC))\\n // accumulator_2 = v29.[ID4]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n /**\\n * COMPUTE BATCH EVALUATION SCALAR MULTIPLIER\\n */\\n {\\n /**\\n * batch_evaluation = v0 * (w_1_omega * u + w_1_eval)\\n * batch_evaluation += v1 * (w_2_omega * u + w_2_eval)\\n * batch_evaluation += v2 * (w_3_omega * u + w_3_eval)\\n * batch_evaluation += v3 * (w_4_omega * u + w_4_eval)\\n * batch_evaluation += v4 * (s_omega_eval * u + s_eval)\\n * batch_evaluation += v5 * (z_omega_eval * u + z_eval)\\n * batch_evaluation += v6 * (z_lookup_omega_eval * u + z_lookup_eval)\\n */\\n let batch_evaluation :=\\n mulmod(\\n mload(C_V0_LOC),\\n addmod(mulmod(mload(W1_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(W1_EVAL_LOC), p),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V1_LOC),\\n addmod(mulmod(mload(W2_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(W2_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V2_LOC),\\n addmod(mulmod(mload(W3_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(W3_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V3_LOC),\\n addmod(mulmod(mload(W4_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(W4_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V4_LOC),\\n addmod(mulmod(mload(S_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(S_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V5_LOC),\\n addmod(mulmod(mload(Z_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(Z_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V6_LOC),\\n addmod(mulmod(mload(Z_LOOKUP_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(Z_LOOKUP_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n\\n /**\\n * batch_evaluation += v7 * Q1_EVAL\\n * batch_evaluation += v8 * Q2_EVAL\\n * batch_evaluation += v9 * Q3_EVAL\\n * batch_evaluation += v10 * Q4_EVAL\\n * batch_evaluation += v11 * QM_EVAL\\n * batch_evaluation += v12 * QC_EVAL\\n * batch_evaluation += v13 * QARITH_EVAL\\n * batch_evaluation += v14 * QSORT_EVAL_LOC\\n * batch_evaluation += v15 * QELLIPTIC_EVAL_LOC\\n * batch_evaluation += v16 * QAUX_EVAL_LOC\\n * batch_evaluation += v17 * SIGMA1_EVAL_LOC\\n * batch_evaluation += v18 * SIGMA2_EVAL_LOC\\n * batch_evaluation += v19 * SIGMA3_EVAL_LOC\\n * batch_evaluation += v20 * SIGMA4_EVAL_LOC\\n */\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V7_LOC), mload(Q1_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V8_LOC), mload(Q2_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V9_LOC), mload(Q3_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V10_LOC), mload(Q4_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V11_LOC), mload(QM_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V12_LOC), mload(QC_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V13_LOC), mload(QARITH_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V14_LOC), mload(QSORT_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V15_LOC), mload(QELLIPTIC_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V16_LOC), mload(QAUX_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V17_LOC), mload(SIGMA1_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V18_LOC), mload(SIGMA2_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V19_LOC), mload(SIGMA3_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V20_LOC), mload(SIGMA4_EVAL_LOC), p), p)\\n\\n /**\\n * batch_evaluation += v21 * (table1(zw) * u + table1(z))\\n * batch_evaluation += v22 * (table2(zw) * u + table2(z))\\n * batch_evaluation += v23 * (table3(zw) * u + table3(z))\\n * batch_evaluation += v24 * (table4(zw) * u + table4(z))\\n * batch_evaluation += v25 * table_type_eval\\n * batch_evaluation += v26 * id1_eval\\n * batch_evaluation += v27 * id2_eval\\n * batch_evaluation += v28 * id3_eval\\n * batch_evaluation += v29 * id4_eval\\n * batch_evaluation += quotient_eval\\n */\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V21_LOC),\\n addmod(mulmod(mload(TABLE1_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(TABLE1_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V22_LOC),\\n addmod(mulmod(mload(TABLE2_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(TABLE2_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V23_LOC),\\n addmod(mulmod(mload(TABLE3_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(TABLE3_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation :=\\n addmod(\\n batch_evaluation,\\n mulmod(\\n mload(C_V24_LOC),\\n addmod(mulmod(mload(TABLE4_OMEGA_EVAL_LOC), mload(C_U_LOC), p), mload(TABLE4_EVAL_LOC), p),\\n p\\n ),\\n p\\n )\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V25_LOC), mload(TABLE_TYPE_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V26_LOC), mload(ID1_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V27_LOC), mload(ID2_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V28_LOC), mload(ID3_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mulmod(mload(C_V29_LOC), mload(ID4_EVAL_LOC), p), p)\\n batch_evaluation := addmod(batch_evaluation, mload(QUOTIENT_EVAL_LOC), p)\\n\\n mstore(0x00, 0x01) // [1].x\\n mstore(0x20, 0x02) // [1].y\\n mstore(0x40, sub(p, batch_evaluation))\\n // accumulator_2 = -[1].(batch_evaluation)\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n if iszero(success) {\\n mstore(0x0, OPENING_COMMITMENT_FAILED_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n }\\n\\n /**\\n * PERFORM PAIRING PREAMBLE\\n */\\n {\\n let u := mload(C_U_LOC)\\n let zeta := mload(C_ZETA_LOC)\\n // VALIDATE PI_Z\\n {\\n let x := mload(PI_Z_X_LOC)\\n let y := mload(PI_Z_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n // compute zeta.[PI_Z] and add into accumulator\\n mstore(0x40, zeta)\\n success := staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40)\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40))\\n\\n // VALIDATE PI_Z_OMEGA\\n {\\n let x := mload(PI_Z_OMEGA_X_LOC)\\n let y := mload(PI_Z_OMEGA_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n mstore(0x40, mulmod(mulmod(u, zeta, p), mload(OMEGA_LOC), p))\\n // accumulator_2 = u.zeta.omega.[PI_Z_OMEGA]\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40))\\n // PAIRING_RHS = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, PAIRING_RHS_X_LOC, 0x40))\\n\\n mstore(0x00, mload(PI_Z_X_LOC))\\n mstore(0x20, mload(PI_Z_Y_LOC))\\n mstore(0x40, mload(PI_Z_OMEGA_X_LOC))\\n mstore(0x60, mload(PI_Z_OMEGA_Y_LOC))\\n mstore(0x80, u)\\n success := and(success, staticcall(gas(), 7, 0x40, 0x60, 0x40, 0x40))\\n // PAIRING_LHS = [PI_Z] + [PI_Z_OMEGA] * u\\n success := and(success, staticcall(gas(), 6, 0x00, 0x80, PAIRING_LHS_X_LOC, 0x40))\\n // negate lhs y-coordinate\\n mstore(PAIRING_LHS_Y_LOC, sub(q, mload(PAIRING_LHS_Y_LOC)))\\n\\n if mload(CONTAINS_RECURSIVE_PROOF_LOC) {\\n // VALIDATE RECURSIVE P1\\n {\\n let x := mload(RECURSIVE_P1_X_LOC)\\n let y := mload(RECURSIVE_P1_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n\\n // compute u.u.[recursive_p1] and write into 0x60\\n mstore(0x40, mulmod(u, u, p))\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, 0x60, 0x40))\\n // VALIDATE RECURSIVE P2\\n {\\n let x := mload(RECURSIVE_P2_X_LOC)\\n let y := mload(RECURSIVE_P2_Y_LOC)\\n let xx := mulmod(x, x, q)\\n // validate on curve\\n if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) {\\n mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n mstore(0x00, x)\\n mstore(0x20, y)\\n }\\n // compute u.u.[recursive_p2] and write into 0x00\\n // 0x40 still contains u*u\\n success := and(success, staticcall(gas(), 7, 0x00, 0x60, 0x00, 0x40))\\n\\n // compute u.u.[recursiveP1] + rhs and write into rhs\\n mstore(0xa0, mload(PAIRING_RHS_X_LOC))\\n mstore(0xc0, mload(PAIRING_RHS_Y_LOC))\\n success := and(success, staticcall(gas(), 6, 0x60, 0x80, PAIRING_RHS_X_LOC, 0x40))\\n\\n // compute u.u.[recursiveP2] + lhs and write into lhs\\n mstore(0x40, mload(PAIRING_LHS_X_LOC))\\n mstore(0x60, mload(PAIRING_LHS_Y_LOC))\\n success := and(success, staticcall(gas(), 6, 0x00, 0x80, PAIRING_LHS_X_LOC, 0x40))\\n }\\n\\n if iszero(success) {\\n mstore(0x0, PAIRING_PREAMBLE_FAILED_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n }\\n\\n /**\\n * PERFORM PAIRING\\n */\\n {\\n // rhs paired with [1]_2\\n // lhs paired with [x]_2\\n\\n mstore(0x00, mload(PAIRING_RHS_X_LOC))\\n mstore(0x20, mload(PAIRING_RHS_Y_LOC))\\n mstore(0x40, 0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2) // this is [1]_2\\n mstore(0x60, 0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed)\\n mstore(0x80, 0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b)\\n mstore(0xa0, 0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa)\\n\\n mstore(0xc0, mload(PAIRING_LHS_X_LOC))\\n mstore(0xe0, mload(PAIRING_LHS_Y_LOC))\\n mstore(0x100, mload(G2X_X0_LOC))\\n mstore(0x120, mload(G2X_X1_LOC))\\n mstore(0x140, mload(G2X_Y0_LOC))\\n mstore(0x160, mload(G2X_Y1_LOC))\\n\\n success := staticcall(gas(), 8, 0x00, 0x180, 0x00, 0x20)\\n if iszero(and(success, mload(0x00))) {\\n mstore(0x0, PAIRING_FAILED_SELECTOR)\\n revert(0x00, 0x04)\\n }\\n }\\n\\n {\\n mstore(0x00, 0x01)\\n return(0x00, 0x20) // Proof succeeded!\\n }\\n }\\n }\\n}\\n\\ncontract UltraVerifier is BaseUltraVerifier {\\n function getVerificationKeyHash() public pure override(BaseUltraVerifier) returns (bytes32) {\\n return UltraVerificationKey.verificationKeyHash();\\n }\\n\\n function loadVerificationKey(uint256 vk, uint256 _omegaInverseLoc) internal pure virtual override(BaseUltraVerifier) {\\n UltraVerificationKey.loadVerificationKey(vk, _omegaInverseLoc);\\n }\\n}\\n\",\"keccak256\":\"0x9ba7ac5c50cddbdf58b0f03b195df323d9f81981e6c9c043b2aa54b537133f06\",\"license\":\"Apache-2.0\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516134dd3803806134dd83398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b612af6806109e783390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b6080516109086100df60003960008181604b0152818160c401526101d501526109086000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780638186328814610096578063fa45edfb146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a4366004610348565b6100bc565b61006d6100b7366004610348565b6101a6565b60008060001b7f0000000000000000000000000000000000000000000000000000000000000000836040516024016100f49190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052516101749061033b565b61017f929190610418565b8190604051809103906000f590508015801561019f573d6000803e3d6000fd5b5092915050565b60006102e16000801b604051806020016101bf9061033b565b6020820181038252601f19601f820116604052507f0000000000000000000000000000000000000000000000000000000000000000856040516024016102059190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052905161028a93929101610418565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526102c69291602001610486565b604051602081830303815290604052805190602001206102e7565b92915050565b60006102f48383306102fb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff81536055902073ffffffffffffffffffffffffffffffffffffffff16949350505050565b61041d806104b683390190565b6000608082840312801561035b57600080fd5b509092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461038557600080fd5b50565b81358152602080830135908201526080810160408301356103a881610363565b73ffffffffffffffffffffffffffffffffffffffff16604083015260608301356103d181610363565b73ffffffffffffffffffffffffffffffffffffffff811660608401525092915050565b60005b8381101561040f5781810151838201526020016103f7565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104538160608501602087016103f4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104988184602088016103f4565b8351908301906104ac8183602088016103f4565b0194935050505056fe608060405260405161041d38038061041d83398101604081905261002291610268565b61002c8282610033565b5050610358565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b919061033c565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b038111156102ae57600080fd5b8301601f810185136102bf57600080fd5b80516001600160401b038111156102d8576102d861022e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103065761030661022e565b60405281815282820160200187101561031e57600080fd5b61032f826020830160208601610244565b8093505050509250929050565b6000825161034e818460208701610244565b9190910192915050565b60b7806103666000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220f1b09f534c51785fb64f6d562751f2bfff62c23101c6e5ebe906ffba3b0c3e3164736f6c634300081b0033a26469706673582212208dd45d082afd368ba400cd011f27e09307a1b820c0a0b70bb3b6421028be9b9e64736f6c634300081b003360c06040523060805234801561001457600080fd5b50604051612af6380380612af683398101604081905261003391610100565b6001600160a01b03811660a05261004861004e565b50610130565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561009e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100fd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60006020828403121561011257600080fd5b81516001600160a01b038116811461012957600080fd5b9392505050565b60805160a05161296961018d60003960008181610425015281816107f3015281816108a101528181610df201528181610eb001528181610ef701526110ce0152600081816112cd015281816112f6015261151201526129696000f3fe6080604052600436106101635760003560e01c8063ad3cb1cc116100c0578063b6f360fb11610074578063c399ec8811610059578063c399ec8814610527578063d087d2881461053c578063f23a6e611461055157600080fd5b8063b6f360fb146104bf578063bc197c81146104df57600080fd5b8063b2e684be116100a5578063b2e684be1461046a578063b387ef921461048a578063b61d27f61461049f57600080fd5b8063ad3cb1cc146103c0578063b0d691fe1461041657600080fd5b80634bd834c7116101175780634f1ef286116100fc5780634f1ef2861461032057806352d1902d146103335780637a28f8bc1461034857600080fd5b80634bd834c7146102725780634d44560d1461030057600080fd5b806319822f7c1161014857806319822f7c1461021a57806334fcd5be146102485780634a58db191461026a57600080fd5b806301ffc9a71461016f578063150b7a02146101a457600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b5061018f61018a366004611ef4565b610597565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101e96101bf366004611fa1565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161019b565b34801561022657600080fd5b5061023a610235366004612014565b61067c565b60405190815260200161019b565b34801561025457600080fd5b506102686102633660046120ad565b610708565b005b6102686107f1565b34801561027e57600080fd5b506000546102c79073ffffffffffffffffffffffffffffffffffffffff8116907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff90911660208301520161019b565b34801561030c57600080fd5b5061026861031b3660046120ef565b610897565b61026861032e3660046121f7565b61094e565b34801561033f57600080fd5b5061023a61096d565b34801561035457600080fd5b5060015460025460035460045461038493929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff9182169284019290925216606082015260800161019b565b3480156103cc57600080fd5b506104096040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161019b91906122b5565b34801561042257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561047657600080fd5b506102686104853660046122e0565b61099c565b34801561049657600080fd5b50610445610b6c565b3480156104ab57600080fd5b506102686104ba366004612315565b610bd8565b3480156104cb57600080fd5b506102686104da366004612371565b610c27565b3480156104eb57600080fd5b506101e96104fa36600461238d565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561053357600080fd5b5061023a610dac565b34801561054857600080fd5b5061023a610e63565b34801561055d57600080fd5b506101e961056c366004612458565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60007fb2e684be000000000000000000000000000000000000000000000000000000006106ac60608601866124d4565b6106b591612539565b7fffffffff0000000000000000000000000000000000000000000000000000000016036106e457506000610701565b6106ec610edf565b6106f68484610f80565b90506107018261104b565b9392505050565b6107106110b6565b60005b818110156107ec576107e48383838181106107305761073061259f565b905060200281019061074291906125ce565b61075090602081019061260c565b8484848181106107625761076261259f565b905060200281019061077491906125ce565b6020013585858581811061078a5761078a61259f565b905060200281019061079c91906125ce565b6107aa9060408101906124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b600101610713565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b5050505050565b61089f61120f565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050505050565b6109566112b5565b61095f826113b9565b61096982826113c1565b5050565b60006109776114fa565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b426109ad610e106020840135612658565b1015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20657870697265642070726f6f660000000000000060448201526064015b60405180910390fd5b604080516080810182526001548152600254602082015260035473ffffffffffffffffffffffffffffffffffffffff908116928201929092526004549091166060820152600090610a7390610a6e8461266b565b611569565b905080610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f66000000000000006044820152606401610a11565b6040518060400160405280836040013560001c73ffffffffffffffffffffffffffffffffffffffff1681526020016201518042610b1991906126ee565b6bffffffffffffffffffffffff908116909152815160209092015116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116176000555050565b604080518082019091526000805473ffffffffffffffffffffffffffffffffffffffff811683527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208301819052909190421115610bd257600091505090565b51919050565b610be06110b6565b610c21848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610c725750825b905060008267ffffffffffffffff166001148015610c8f5750303b155b905081158015610c9d575080155b15610cd4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610d355784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b856001610d428282612712565b505083156109465784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e91906127c6565b905090565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610e1d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610a11565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610ffb81610fc16101008701876124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061185592505050565b73ffffffffffffffffffffffffffffffffffffffff16611019610b6c565b73ffffffffffffffffffffffffffffffffffffffff161461103e576001915050610676565b5060009392505050565b50565b80156110485760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610890565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061112c57506110fd610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152606401610a11565b6000808473ffffffffffffffffffffffffffffffffffffffff1684846040516111bb91906127df565b60006040518083038185875af1925050503d80600081146111f8576040519150601f19603f3d011682016040523d82523d6000602084013e6111fd565b606091505b50915091508161089057805160208201fd5b611217610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061124f57503330145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152606401610a11565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061138257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166113697f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61104861120f565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611446575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611443918101906127c6565b60015b611494576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146114f0576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6107ec838361187f565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016115bb929190918252602082015260400190565b602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc91906127f1565b611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610a11565b600061167183604001516118e2565b80519091506003906000906116869083612658565b67ffffffffffffffff81111561169e5761169e61211b565b6040519080825280602002602001820160405280156116c7578160200160208202803683370190505b50865190915060009082826116db81612813565b9350815181106116ed576116ed61259f565b602002602001018181525050856020015160001b82828061170d90612813565b93508151811061171f5761171f61259f565b60209081029190910101526060860151828261173a81612813565b93508151811061174c5761174c61259f565b60200260200101818152505060005b84518110156117ae578481815181106117765761177661259f565b016020015160f81c838361178981612813565b94508151811061179b5761179b61259f565b602090810291909101015260010161175b565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e49161180991869060040161284b565b602060405180830381865afa158015611826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184a91906127f1565b979650505050505050565b60008060008061186586866118ef565b925092509250611875828261193c565b5090949350505050565b61188882611a40565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118da576107ec8282611b0f565b610969611b92565b6060610676826020611bca565b600080600083516041036119295760208401516040850151606086015160001a61191b88828585611d29565b955095509550505050611935565b50508151600091506002905b9250925092565b6000826003811115611950576119506128a5565b03611959575050565b600182600381111561196d5761196d6128a5565b036119a4576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156119b8576119b86128a5565b036119f2576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6003826003811115611a0657611a066128a5565b03610969576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611aa9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051611b3991906127df565b600060405180830381855af49150503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5091509150611b89858383611e23565b95945050505050565b3415610f7e576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826000611bda8460026128d4565b67ffffffffffffffff811115611bf257611bf261211b565b6040519080825280601f01601f191660200182016040528015611c1c576020820181803683370190505b5090506000611c2c8560026128d4565b611c37906001612658565b90505b6001811115611cde577f303132333435363738396162636465660000000000000000000000000000000083600f1660108110611c7857611c7861259f565b1a60f81b82611c886002846128eb565b81518110611c9857611c9861259f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c91611cd7816128fe565b9050611c3a565b508115611d21576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610a11565b949350505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611d645750600091506003905082611e19565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611db8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611e0f57506000925060019150829050611e19565b9250600091508190505b9450945094915050565b606082611e3857611e3382611eb2565b610701565b8151158015611e5c575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611eab576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610a11565b5080610701565b805115611ec25780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215611f0657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461104857600080fd5b60008083601f840112611f6a57600080fd5b50813567ffffffffffffffff811115611f8257600080fd5b602083019150836020828501011115611f9a57600080fd5b9250929050565b600080600080600060808688031215611fb957600080fd5b8535611fc481611f36565b94506020860135611fd481611f36565b935060408601359250606086013567ffffffffffffffff811115611ff757600080fd5b61200388828901611f58565b969995985093965092949392505050565b60008060006060848603121561202957600080fd5b833567ffffffffffffffff81111561204057600080fd5b8401610120818703121561205357600080fd5b95602085013595506040909401359392505050565b60008083601f84011261207a57600080fd5b50813567ffffffffffffffff81111561209257600080fd5b6020830191508360208260051b8501011115611f9a57600080fd5b600080602083850312156120c057600080fd5b823567ffffffffffffffff8111156120d757600080fd5b6120e385828601612068565b90969095509350505050565b6000806040838503121561210257600080fd5b823561210d81611f36565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261215b57600080fd5b813567ffffffffffffffff8111156121755761217561211b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156121c2576121c261211b565b6040528181528382016020018510156121da57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561220a57600080fd5b823561221581611f36565b9150602083013567ffffffffffffffff81111561223157600080fd5b61223d8582860161214a565b9150509250929050565b60005b8381101561226257818101518382015260200161224a565b50506000910152565b60008151808452612283816020860160208601612247565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610701602083018461226b565b6000608082840312156122da57600080fd5b50919050565b6000602082840312156122f257600080fd5b813567ffffffffffffffff81111561230957600080fd5b611d21848285016122c8565b6000806000806060858703121561232b57600080fd5b843561233681611f36565b935060208501359250604085013567ffffffffffffffff81111561235957600080fd5b61236587828801611f58565b95989497509550505050565b60006080828403121561238357600080fd5b61070183836122c8565b60008060008060008060008060a0898b0312156123a957600080fd5b88356123b481611f36565b975060208901356123c481611f36565b9650604089013567ffffffffffffffff8111156123e057600080fd5b6123ec8b828c01612068565b909750955050606089013567ffffffffffffffff81111561240c57600080fd5b6124188b828c01612068565b909550935050608089013567ffffffffffffffff81111561243857600080fd5b6124448b828c01611f58565b999c989b5096995094979396929594505050565b60008060008060008060a0878903121561247157600080fd5b863561247c81611f36565b9550602087013561248c81611f36565b94506040870135935060608701359250608087013567ffffffffffffffff8111156124b657600080fd5b6124c289828a01611f58565b979a9699509497509295939492505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261250957600080fd5b83018035915067ffffffffffffffff82111561252457600080fd5b602001915036819003821315611f9a57600080fd5b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015612598577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261260257600080fd5b9190910192915050565b60006020828403121561261e57600080fd5b813561070181611f36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561067657610676612629565b60006080823603121561267d57600080fd5b6040516080810167ffffffffffffffff811182821017156126a0576126a061211b565b604052823567ffffffffffffffff8111156126ba57600080fd5b6126c63682860161214a565b8252506020838101359082015260408084013590820152606092830135928101929092525090565b6bffffffffffffffffffffffff818116838216019081111561067657610676612629565b8135815560208201356001820155604082013561272e81611f36565b6002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905550606082013561277f81611f36565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055505050565b6000602082840312156127d857600080fd5b5051919050565b60008251612602818460208701612247565b60006020828403121561280357600080fd5b8151801515811461070157600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361284457612844612629565b5060010190565b60408152600061285e604083018561226b565b828103602084015280845180835260208301915060208601925060005b8181101561289957835183526020938401939092019160010161287b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b808202811582820484141761067657610676612629565b8181038181111561067657610676612629565b60008161290d5761290d612629565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212202ffaebc956cf206ecce7d0b751c6aea797e4821b45a54ec89796f56c882d703f64736f6c634300081b0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780638186328814610096578063fa45edfb146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a4366004610348565b6100bc565b61006d6100b7366004610348565b6101a6565b60008060001b7f0000000000000000000000000000000000000000000000000000000000000000836040516024016100f49190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052516101749061033b565b61017f929190610418565b8190604051809103906000f590508015801561019f573d6000803e3d6000fd5b5092915050565b60006102e16000801b604051806020016101bf9061033b565b6020820181038252601f19601f820116604052507f0000000000000000000000000000000000000000000000000000000000000000856040516024016102059190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052905161028a93929101610418565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526102c69291602001610486565b604051602081830303815290604052805190602001206102e7565b92915050565b60006102f48383306102fb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff81536055902073ffffffffffffffffffffffffffffffffffffffff16949350505050565b61041d806104b683390190565b6000608082840312801561035b57600080fd5b509092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461038557600080fd5b50565b81358152602080830135908201526080810160408301356103a881610363565b73ffffffffffffffffffffffffffffffffffffffff16604083015260608301356103d181610363565b73ffffffffffffffffffffffffffffffffffffffff811660608401525092915050565b60005b8381101561040f5781810151838201526020016103f7565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104538160608501602087016103f4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104988184602088016103f4565b8351908301906104ac8183602088016103f4565b0194935050505056fe608060405260405161041d38038061041d83398101604081905261002291610268565b61002c8282610033565b5050610358565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b919061033c565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b038111156102ae57600080fd5b8301601f810185136102bf57600080fd5b80516001600160401b038111156102d8576102d861022e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103065761030661022e565b60405281815282820160200187101561031e57600080fd5b61032f826020830160208601610244565b8093505050509250929050565b6000825161034e818460208701610244565b9190910192915050565b60b7806103666000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220f1b09f534c51785fb64f6d562751f2bfff62c23101c6e5ebe906ffba3b0c3e3164736f6c634300081b0033a26469706673582212208dd45d082afd368ba400cd011f27e09307a1b820c0a0b70bb3b6421028be9b9e64736f6c634300081b0033", + "numDeployments": 19, + "solcInputHash": "8d3d7e5538e592539a63aff937e00165", + "metadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IEntryPoint\",\"name\":\"_entryPoint\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"accountImplementation\",\"outputs\":[{\"internalType\":\"contract SimpleAccount\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"accountId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"authProviderId\",\"type\":\"bytes32\"},{\"internalType\":\"contract PublicKeyRegistry\",\"name\":\"publicKeyRegistry\",\"type\":\"address\"},{\"internalType\":\"contract HonkVerifier\",\"name\":\"proofVerifier\",\"type\":\"address\"}],\"internalType\":\"struct ZkLogin.AccountData\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"createAccount\",\"outputs\":[{\"internalType\":\"contract SimpleAccount\",\"name\":\"ret\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"accountId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"authProviderId\",\"type\":\"bytes32\"},{\"internalType\":\"contract PublicKeyRegistry\",\"name\":\"publicKeyRegistry\",\"type\":\"address\"},{\"internalType\":\"contract HonkVerifier\",\"name\":\"proofVerifier\",\"type\":\"address\"}],\"internalType\":\"struct ZkLogin.AccountData\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"getAccountAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"createAccount((bytes32,bytes32,address,address))\":{\"notice\":\"create an account, and return its address. returns the address even if the account is already deployed. Note that during UserOperation execution, this method is called only if the account is not deployed. This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation\"},\"getAccountAddress((bytes32,bytes32,address,address))\":{\"notice\":\"calculate the counterfactual address of this account as it would be returned by createAccount()\"}},\"notice\":\"A sample factory contract for SimpleAccount A UserOperations \\\"initCode\\\" holds the address of the factory, and a method call (to createAccount, in this sample factory). The factory's createAccount returns the target account address even if it is already installed. This way, the entryPoint.getSenderAddress() can be called either before or after the account is created.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SimpleAccountFactory.sol\":\"SimpleAccountFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100000000},\"remappings\":[]},\"sources\":{\"@account-abstraction/contracts/core/BaseAccount.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable avoid-low-level-calls */\\n/* solhint-disable no-empty-blocks */\\n\\nimport \\\"../interfaces/IAccount.sol\\\";\\nimport \\\"../interfaces/IEntryPoint.sol\\\";\\nimport \\\"./UserOperationLib.sol\\\";\\n\\n/**\\n * Basic account implementation.\\n * This contract provides the basic logic for implementing the IAccount interface - validateUserOp\\n * Specific account implementation should inherit it and provide the account-specific logic.\\n */\\nabstract contract BaseAccount is IAccount {\\n using UserOperationLib for PackedUserOperation;\\n\\n /**\\n * Return the account nonce.\\n * This method returns the next sequential nonce.\\n * For a nonce of a specific key, use `entrypoint.getNonce(account, key)`\\n */\\n function getNonce() public view virtual returns (uint256) {\\n return entryPoint().getNonce(address(this), 0);\\n }\\n\\n /**\\n * Return the entryPoint used by this account.\\n * Subclass should return the current entryPoint used by this account.\\n */\\n function entryPoint() public view virtual returns (IEntryPoint);\\n\\n /// @inheritdoc IAccount\\n function validateUserOp(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash,\\n uint256 missingAccountFunds\\n ) external virtual override returns (uint256 validationData) {\\n _requireFromEntryPoint();\\n validationData = _validateSignature(userOp, userOpHash);\\n _validateNonce(userOp.nonce);\\n _payPrefund(missingAccountFunds);\\n }\\n\\n /**\\n * Ensure the request comes from the known entrypoint.\\n */\\n function _requireFromEntryPoint() internal view virtual {\\n require(\\n msg.sender == address(entryPoint()),\\n \\\"account: not from EntryPoint\\\"\\n );\\n }\\n\\n /**\\n * Validate the signature is valid for this message.\\n * @param userOp - Validate the userOp.signature field.\\n * @param userOpHash - Convenient field: the hash of the request, to check the signature against.\\n * (also hashes the entrypoint and chain id)\\n * @return validationData - Signature and time-range of this operation.\\n * <20-byte> aggregatorOrSigFail - 0 for valid signature, 1 to mark signature failure,\\n * otherwise, an address of an aggregator contract.\\n * <6-byte> validUntil - last timestamp this operation is valid. 0 for \\\"indefinite\\\"\\n * <6-byte> validAfter - first timestamp this operation is valid\\n * If the account doesn't use time-range, it is enough to return\\n * SIG_VALIDATION_FAILED value (1) for signature failure.\\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\\n */\\n function _validateSignature(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash\\n ) internal virtual returns (uint256 validationData);\\n\\n /**\\n * Validate the nonce of the UserOperation.\\n * This method may validate the nonce requirement of this account.\\n * e.g.\\n * To limit the nonce to use sequenced UserOps only (no \\\"out of order\\\" UserOps):\\n * `require(nonce < type(uint64).max)`\\n * For a hypothetical account that *requires* the nonce to be out-of-order:\\n * `require(nonce & type(uint64).max == 0)`\\n *\\n * The actual nonce uniqueness is managed by the EntryPoint, and thus no other\\n * action is needed by the account itself.\\n *\\n * @param nonce to validate\\n *\\n * solhint-disable-next-line no-empty-blocks\\n */\\n function _validateNonce(uint256 nonce) internal view virtual {\\n }\\n\\n /**\\n * Sends to the entrypoint (msg.sender) the missing funds for this transaction.\\n * SubClass MAY override this method for better funds management\\n * (e.g. send to the entryPoint more than the minimum required, so that in future transactions\\n * it will not be required to send again).\\n * @param missingAccountFunds - The minimum value this method should send the entrypoint.\\n * This value MAY be zero, in case there is enough deposit,\\n * or the userOp has a paymaster.\\n */\\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\\n if (missingAccountFunds != 0) {\\n (bool success, ) = payable(msg.sender).call{\\n value: missingAccountFunds,\\n gas: type(uint256).max\\n }(\\\"\\\");\\n (success);\\n //ignore failure (its EntryPoint's job to verify, not account.)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2736272f077d1699b8b8bf8be18d1c20e506668fc52b3293da70d17e63794358\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/core/Helpers.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable no-inline-assembly */\\n\\n\\n /*\\n * For simulation purposes, validateUserOp (and validatePaymasterUserOp)\\n * must return this value in case of signature failure, instead of revert.\\n */\\nuint256 constant SIG_VALIDATION_FAILED = 1;\\n\\n\\n/*\\n * For simulation purposes, validateUserOp (and validatePaymasterUserOp)\\n * return this value on success.\\n */\\nuint256 constant SIG_VALIDATION_SUCCESS = 0;\\n\\n\\n/**\\n * Returned data from validateUserOp.\\n * validateUserOp returns a uint256, which is created by `_packedValidationData` and\\n * parsed by `_parseValidationData`.\\n * @param aggregator - address(0) - The account validated the signature by itself.\\n * address(1) - The account failed to validate the signature.\\n * otherwise - This is an address of a signature aggregator that must\\n * be used to validate the signature.\\n * @param validAfter - This UserOp is valid only after this timestamp.\\n * @param validaUntil - This UserOp is valid only up to this timestamp.\\n */\\nstruct ValidationData {\\n address aggregator;\\n uint48 validAfter;\\n uint48 validUntil;\\n}\\n\\n/**\\n * Extract sigFailed, validAfter, validUntil.\\n * Also convert zero validUntil to type(uint48).max.\\n * @param validationData - The packed validation data.\\n */\\nfunction _parseValidationData(\\n uint256 validationData\\n) pure returns (ValidationData memory data) {\\n address aggregator = address(uint160(validationData));\\n uint48 validUntil = uint48(validationData >> 160);\\n if (validUntil == 0) {\\n validUntil = type(uint48).max;\\n }\\n uint48 validAfter = uint48(validationData >> (48 + 160));\\n return ValidationData(aggregator, validAfter, validUntil);\\n}\\n\\n/**\\n * Helper to pack the return value for validateUserOp.\\n * @param data - The ValidationData to pack.\\n */\\nfunction _packValidationData(\\n ValidationData memory data\\n) pure returns (uint256) {\\n return\\n uint160(data.aggregator) |\\n (uint256(data.validUntil) << 160) |\\n (uint256(data.validAfter) << (160 + 48));\\n}\\n\\n/**\\n * Helper to pack the return value for validateUserOp, when not using an aggregator.\\n * @param sigFailed - True for signature failure, false for success.\\n * @param validUntil - Last timestamp this UserOperation is valid (or zero for infinite).\\n * @param validAfter - First timestamp this UserOperation is valid.\\n */\\nfunction _packValidationData(\\n bool sigFailed,\\n uint48 validUntil,\\n uint48 validAfter\\n) pure returns (uint256) {\\n return\\n (sigFailed ? 1 : 0) |\\n (uint256(validUntil) << 160) |\\n (uint256(validAfter) << (160 + 48));\\n}\\n\\n/**\\n * keccak function over calldata.\\n * @dev copy calldata into memory, do keccak and drop allocated memory. Strangely, this is more efficient than letting solidity do it.\\n */\\n function calldataKeccak(bytes calldata data) pure returns (bytes32 ret) {\\n assembly (\\\"memory-safe\\\") {\\n let mem := mload(0x40)\\n let len := data.length\\n calldatacopy(mem, data.offset, len)\\n ret := keccak256(mem, len)\\n }\\n }\\n\\n\\n/**\\n * The minimum of two numbers.\\n * @param a - First number.\\n * @param b - Second number.\\n */\\n function min(uint256 a, uint256 b) pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\",\"keccak256\":\"0x6247e011a6cb0b263b3aa098822977181674d91b62e5bdfe04c6e66f72da25d6\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/core/UserOperationLib.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable no-inline-assembly */\\n\\nimport \\\"../interfaces/PackedUserOperation.sol\\\";\\nimport {calldataKeccak, min} from \\\"./Helpers.sol\\\";\\n\\n/**\\n * Utility functions helpful when working with UserOperation structs.\\n */\\nlibrary UserOperationLib {\\n\\n uint256 public constant PAYMASTER_VALIDATION_GAS_OFFSET = 20;\\n uint256 public constant PAYMASTER_POSTOP_GAS_OFFSET = 36;\\n uint256 public constant PAYMASTER_DATA_OFFSET = 52;\\n /**\\n * Get sender from user operation data.\\n * @param userOp - The user operation data.\\n */\\n function getSender(\\n PackedUserOperation calldata userOp\\n ) internal pure returns (address) {\\n address data;\\n //read sender from userOp, which is first userOp member (saves 800 gas...)\\n assembly {\\n data := calldataload(userOp)\\n }\\n return address(uint160(data));\\n }\\n\\n /**\\n * Relayer/block builder might submit the TX with higher priorityFee,\\n * but the user should not pay above what he signed for.\\n * @param userOp - The user operation data.\\n */\\n function gasPrice(\\n PackedUserOperation calldata userOp\\n ) internal view returns (uint256) {\\n unchecked {\\n (uint256 maxPriorityFeePerGas, uint256 maxFeePerGas) = unpackUints(userOp.gasFees);\\n if (maxFeePerGas == maxPriorityFeePerGas) {\\n //legacy mode (for networks that don't support basefee opcode)\\n return maxFeePerGas;\\n }\\n return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\\n }\\n }\\n\\n /**\\n * Pack the user operation data into bytes for hashing.\\n * @param userOp - The user operation data.\\n */\\n function encode(\\n PackedUserOperation calldata userOp\\n ) internal pure returns (bytes memory ret) {\\n address sender = getSender(userOp);\\n uint256 nonce = userOp.nonce;\\n bytes32 hashInitCode = calldataKeccak(userOp.initCode);\\n bytes32 hashCallData = calldataKeccak(userOp.callData);\\n bytes32 accountGasLimits = userOp.accountGasLimits;\\n uint256 preVerificationGas = userOp.preVerificationGas;\\n bytes32 gasFees = userOp.gasFees;\\n bytes32 hashPaymasterAndData = calldataKeccak(userOp.paymasterAndData);\\n\\n return abi.encode(\\n sender, nonce,\\n hashInitCode, hashCallData,\\n accountGasLimits, preVerificationGas, gasFees,\\n hashPaymasterAndData\\n );\\n }\\n\\n function unpackUints(\\n bytes32 packed\\n ) internal pure returns (uint256 high128, uint256 low128) {\\n return (uint128(bytes16(packed)), uint128(uint256(packed)));\\n }\\n\\n //unpack just the high 128-bits from a packed value\\n function unpackHigh128(bytes32 packed) internal pure returns (uint256) {\\n return uint256(packed) >> 128;\\n }\\n\\n // unpack just the low 128-bits from a packed value\\n function unpackLow128(bytes32 packed) internal pure returns (uint256) {\\n return uint128(uint256(packed));\\n }\\n\\n function unpackMaxPriorityFeePerGas(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackHigh128(userOp.gasFees);\\n }\\n\\n function unpackMaxFeePerGas(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackLow128(userOp.gasFees);\\n }\\n\\n function unpackVerificationGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackHigh128(userOp.accountGasLimits);\\n }\\n\\n function unpackCallGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return unpackLow128(userOp.accountGasLimits);\\n }\\n\\n function unpackPaymasterVerificationGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET]));\\n }\\n\\n function unpackPostOpGasLimit(PackedUserOperation calldata userOp)\\n internal pure returns (uint256) {\\n return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]));\\n }\\n\\n function unpackPaymasterStaticFields(\\n bytes calldata paymasterAndData\\n ) internal pure returns (address paymaster, uint256 validationGasLimit, uint256 postOpGasLimit) {\\n return (\\n address(bytes20(paymasterAndData[: PAYMASTER_VALIDATION_GAS_OFFSET])),\\n uint128(bytes16(paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET])),\\n uint128(bytes16(paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]))\\n );\\n }\\n\\n /**\\n * Hash the user operation data.\\n * @param userOp - The user operation data.\\n */\\n function hash(\\n PackedUserOperation calldata userOp\\n ) internal pure returns (bytes32) {\\n return keccak256(encode(userOp));\\n }\\n}\\n\",\"keccak256\":\"0x9d50ece985d35f82e33e5da417595c86fac10449e3d10895d08363d33aad454b\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IAccount.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\nimport \\\"./PackedUserOperation.sol\\\";\\n\\ninterface IAccount {\\n /**\\n * Validate user's signature and nonce\\n * the entryPoint will make the call to the recipient only if this validation call returns successfully.\\n * signature failure should be reported by returning SIG_VALIDATION_FAILED (1).\\n * This allows making a \\\"simulation call\\\" without a valid signature\\n * Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure.\\n *\\n * @dev Must validate caller is the entryPoint.\\n * Must validate the signature and nonce\\n * @param userOp - The operation that is about to be executed.\\n * @param userOpHash - Hash of the user's request data. can be used as the basis for signature.\\n * @param missingAccountFunds - Missing funds on the account's deposit in the entrypoint.\\n * This is the minimum amount to transfer to the sender(entryPoint) to be\\n * able to make the call. The excess is left as a deposit in the entrypoint\\n * for future calls. Can be withdrawn anytime using \\\"entryPoint.withdrawTo()\\\".\\n * In case there is a paymaster in the request (or the current deposit is high\\n * enough), this value will be zero.\\n * @return validationData - Packaged ValidationData structure. use `_packValidationData` and\\n * `_unpackValidationData` to encode and decode.\\n * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure,\\n * otherwise, an address of an \\\"authorizer\\\" contract.\\n * <6-byte> validUntil - Last timestamp this operation is valid. 0 for \\\"indefinite\\\"\\n * <6-byte> validAfter - First timestamp this operation is valid\\n * If an account doesn't use time-range, it is enough to\\n * return SIG_VALIDATION_FAILED value (1) for signature failure.\\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\\n */\\n function validateUserOp(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash,\\n uint256 missingAccountFunds\\n ) external returns (uint256 validationData);\\n}\\n\",\"keccak256\":\"0x38710bec0cb20ff4ceef46a80475b5bdabc27b7efd2687fd473db68332f61b78\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IAggregator.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\nimport \\\"./PackedUserOperation.sol\\\";\\n\\n/**\\n * Aggregated Signatures validator.\\n */\\ninterface IAggregator {\\n /**\\n * Validate aggregated signature.\\n * Revert if the aggregated signature does not match the given list of operations.\\n * @param userOps - Array of UserOperations to validate the signature for.\\n * @param signature - The aggregated signature.\\n */\\n function validateSignatures(\\n PackedUserOperation[] calldata userOps,\\n bytes calldata signature\\n ) external view;\\n\\n /**\\n * Validate signature of a single userOp.\\n * This method should be called by bundler after EntryPointSimulation.simulateValidation() returns\\n * the aggregator this account uses.\\n * First it validates the signature over the userOp. Then it returns data to be used when creating the handleOps.\\n * @param userOp - The userOperation received from the user.\\n * @return sigForUserOp - The value to put into the signature field of the userOp when calling handleOps.\\n * (usually empty, unless account and aggregator support some kind of \\\"multisig\\\".\\n */\\n function validateUserOpSignature(\\n PackedUserOperation calldata userOp\\n ) external view returns (bytes memory sigForUserOp);\\n\\n /**\\n * Aggregate multiple signatures into a single value.\\n * This method is called off-chain to calculate the signature to pass with handleOps()\\n * bundler MAY use optimized custom code perform this aggregation.\\n * @param userOps - Array of UserOperations to collect the signatures from.\\n * @return aggregatedSignature - The aggregated signature.\\n */\\n function aggregateSignatures(\\n PackedUserOperation[] calldata userOps\\n ) external view returns (bytes memory aggregatedSignature);\\n}\\n\",\"keccak256\":\"0xf100d6fcc0c3b450b13e979b6a42c628c292a1bc340eccc2e7796b80e3975588\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IEntryPoint.sol\":{\"content\":\"/**\\n ** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.\\n ** Only one instance required on each chain.\\n **/\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\n/* solhint-disable avoid-low-level-calls */\\n/* solhint-disable no-inline-assembly */\\n/* solhint-disable reason-string */\\n\\nimport \\\"./PackedUserOperation.sol\\\";\\nimport \\\"./IStakeManager.sol\\\";\\nimport \\\"./IAggregator.sol\\\";\\nimport \\\"./INonceManager.sol\\\";\\n\\ninterface IEntryPoint is IStakeManager, INonceManager {\\n /***\\n * An event emitted after each successful request.\\n * @param userOpHash - Unique identifier for the request (hash its entire content, except signature).\\n * @param sender - The account that generates this request.\\n * @param paymaster - If non-null, the paymaster that pays for this request.\\n * @param nonce - The nonce value from the request.\\n * @param success - True if the sender transaction succeeded, false if reverted.\\n * @param actualGasCost - Actual amount paid (by account or paymaster) for this UserOperation.\\n * @param actualGasUsed - Total gas used by this UserOperation (including preVerification, creation,\\n * validation and execution).\\n */\\n event UserOperationEvent(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n address indexed paymaster,\\n uint256 nonce,\\n bool success,\\n uint256 actualGasCost,\\n uint256 actualGasUsed\\n );\\n\\n /**\\n * Account \\\"sender\\\" was deployed.\\n * @param userOpHash - The userOp that deployed this account. UserOperationEvent will follow.\\n * @param sender - The account that is deployed\\n * @param factory - The factory used to deploy this account (in the initCode)\\n * @param paymaster - The paymaster used by this UserOp\\n */\\n event AccountDeployed(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n address factory,\\n address paymaster\\n );\\n\\n /**\\n * An event emitted if the UserOperation \\\"callData\\\" reverted with non-zero length.\\n * @param userOpHash - The request unique identifier.\\n * @param sender - The sender of this request.\\n * @param nonce - The nonce used in the request.\\n * @param revertReason - The return bytes from the (reverted) call to \\\"callData\\\".\\n */\\n event UserOperationRevertReason(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n uint256 nonce,\\n bytes revertReason\\n );\\n\\n /**\\n * An event emitted if the UserOperation Paymaster's \\\"postOp\\\" call reverted with non-zero length.\\n * @param userOpHash - The request unique identifier.\\n * @param sender - The sender of this request.\\n * @param nonce - The nonce used in the request.\\n * @param revertReason - The return bytes from the (reverted) call to \\\"callData\\\".\\n */\\n event PostOpRevertReason(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n uint256 nonce,\\n bytes revertReason\\n );\\n\\n /**\\n * UserOp consumed more than prefund. The UserOperation is reverted, and no refund is made.\\n * @param userOpHash - The request unique identifier.\\n * @param sender - The sender of this request.\\n * @param nonce - The nonce used in the request.\\n */\\n event UserOperationPrefundTooLow(\\n bytes32 indexed userOpHash,\\n address indexed sender,\\n uint256 nonce\\n );\\n\\n /**\\n * An event emitted by handleOps(), before starting the execution loop.\\n * Any event emitted before this event, is part of the validation.\\n */\\n event BeforeExecution();\\n\\n /**\\n * Signature aggregator used by the following UserOperationEvents within this bundle.\\n * @param aggregator - The aggregator used for the following UserOperationEvents.\\n */\\n event SignatureAggregatorChanged(address indexed aggregator);\\n\\n /**\\n * A custom revert error of handleOps, to identify the offending op.\\n * Should be caught in off-chain handleOps simulation and not happen on-chain.\\n * Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts.\\n * NOTE: If simulateValidation passes successfully, there should be no reason for handleOps to fail on it.\\n * @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).\\n * @param reason - Revert reason. The string starts with a unique code \\\"AAmn\\\",\\n * where \\\"m\\\" is \\\"1\\\" for factory, \\\"2\\\" for account and \\\"3\\\" for paymaster issues,\\n * so a failure can be attributed to the correct entity.\\n */\\n error FailedOp(uint256 opIndex, string reason);\\n\\n /**\\n * A custom revert error of handleOps, to report a revert by account or paymaster.\\n * @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).\\n * @param reason - Revert reason. see FailedOp(uint256,string), above\\n * @param inner - data from inner cought revert reason\\n * @dev note that inner is truncated to 2048 bytes\\n */\\n error FailedOpWithRevert(uint256 opIndex, string reason, bytes inner);\\n\\n error PostOpReverted(bytes returnData);\\n\\n /**\\n * Error case when a signature aggregator fails to verify the aggregated signature it had created.\\n * @param aggregator The aggregator that failed to verify the signature\\n */\\n error SignatureValidationFailed(address aggregator);\\n\\n // Return value of getSenderAddress.\\n error SenderAddressResult(address sender);\\n\\n // UserOps handled, per aggregator.\\n struct UserOpsPerAggregator {\\n PackedUserOperation[] userOps;\\n // Aggregator address\\n IAggregator aggregator;\\n // Aggregated signature\\n bytes signature;\\n }\\n\\n /**\\n * Execute a batch of UserOperations.\\n * No signature aggregator is used.\\n * If any account requires an aggregator (that is, it returned an aggregator when\\n * performing simulateValidation), then handleAggregatedOps() must be used instead.\\n * @param ops - The operations to execute.\\n * @param beneficiary - The address to receive the fees.\\n */\\n function handleOps(\\n PackedUserOperation[] calldata ops,\\n address payable beneficiary\\n ) external;\\n\\n /**\\n * Execute a batch of UserOperation with Aggregators\\n * @param opsPerAggregator - The operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts).\\n * @param beneficiary - The address to receive the fees.\\n */\\n function handleAggregatedOps(\\n UserOpsPerAggregator[] calldata opsPerAggregator,\\n address payable beneficiary\\n ) external;\\n\\n /**\\n * Generate a request Id - unique identifier for this request.\\n * The request ID is a hash over the content of the userOp (except the signature), the entrypoint and the chainid.\\n * @param userOp - The user operation to generate the request ID for.\\n * @return hash the hash of this UserOperation\\n */\\n function getUserOpHash(\\n PackedUserOperation calldata userOp\\n ) external view returns (bytes32);\\n\\n /**\\n * Gas and return values during simulation.\\n * @param preOpGas - The gas used for validation (including preValidationGas)\\n * @param prefund - The required prefund for this operation\\n * @param accountValidationData - returned validationData from account.\\n * @param paymasterValidationData - return validationData from paymaster.\\n * @param paymasterContext - Returned by validatePaymasterUserOp (to be passed into postOp)\\n */\\n struct ReturnInfo {\\n uint256 preOpGas;\\n uint256 prefund;\\n uint256 accountValidationData;\\n uint256 paymasterValidationData;\\n bytes paymasterContext;\\n }\\n\\n /**\\n * Returned aggregated signature info:\\n * The aggregator returned by the account, and its current stake.\\n */\\n struct AggregatorStakeInfo {\\n address aggregator;\\n StakeInfo stakeInfo;\\n }\\n\\n /**\\n * Get counterfactual sender address.\\n * Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation.\\n * This method always revert, and returns the address in SenderAddressResult error\\n * @param initCode - The constructor code to be passed into the UserOperation.\\n */\\n function getSenderAddress(bytes memory initCode) external;\\n\\n error DelegateAndRevert(bool success, bytes ret);\\n\\n /**\\n * Helper method for dry-run testing.\\n * @dev calling this method, the EntryPoint will make a delegatecall to the given data, and report (via revert) the result.\\n * The method always revert, so is only useful off-chain for dry run calls, in cases where state-override to replace\\n * actual EntryPoint code is less convenient.\\n * @param target a target contract to make a delegatecall from entrypoint\\n * @param data data to pass to target in a delegatecall\\n */\\n function delegateAndRevert(address target, bytes calldata data) external;\\n}\\n\",\"keccak256\":\"0x1972a5fcb3a808b58c85af5741949ef6af11ab0debd3ae8c708171ae1ae0d0c4\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/INonceManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\ninterface INonceManager {\\n\\n /**\\n * Return the next nonce for this sender.\\n * Within a given key, the nonce values are sequenced (starting with zero, and incremented by one on each userop)\\n * But UserOp with different keys can come with arbitrary order.\\n *\\n * @param sender the account address\\n * @param key the high 192 bit of the nonce\\n * @return nonce a full nonce to pass for next UserOp with this sender.\\n */\\n function getNonce(address sender, uint192 key)\\n external view returns (uint256 nonce);\\n\\n /**\\n * Manually increment the nonce of the sender.\\n * This method is exposed just for completeness..\\n * Account does NOT need to call it, neither during validation, nor elsewhere,\\n * as the EntryPoint will update the nonce regardless.\\n * Possible use-case is call it with various keys to \\\"initialize\\\" their nonces to one, so that future\\n * UserOperations will not pay extra for the first transaction with a given key.\\n */\\n function incrementNonce(uint192 key) external;\\n}\\n\",\"keccak256\":\"0xd575af0f6ebbd5f0b2933307d44cd7b4e03a69f4b817a67db5409bd3c89aeecb\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/interfaces/IStakeManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity >=0.7.5;\\n\\n/**\\n * Manage deposits and stakes.\\n * Deposit is just a balance used to pay for UserOperations (either by a paymaster or an account).\\n * Stake is value locked for at least \\\"unstakeDelay\\\" by the staked entity.\\n */\\ninterface IStakeManager {\\n event Deposited(address indexed account, uint256 totalDeposit);\\n\\n event Withdrawn(\\n address indexed account,\\n address withdrawAddress,\\n uint256 amount\\n );\\n\\n // Emitted when stake or unstake delay are modified.\\n event StakeLocked(\\n address indexed account,\\n uint256 totalStaked,\\n uint256 unstakeDelaySec\\n );\\n\\n // Emitted once a stake is scheduled for withdrawal.\\n event StakeUnlocked(address indexed account, uint256 withdrawTime);\\n\\n event StakeWithdrawn(\\n address indexed account,\\n address withdrawAddress,\\n uint256 amount\\n );\\n\\n /**\\n * @param deposit - The entity's deposit.\\n * @param staked - True if this entity is staked.\\n * @param stake - Actual amount of ether staked for this entity.\\n * @param unstakeDelaySec - Minimum delay to withdraw the stake.\\n * @param withdrawTime - First block timestamp where 'withdrawStake' will be callable, or zero if already locked.\\n * @dev Sizes were chosen so that deposit fits into one cell (used during handleOp)\\n * and the rest fit into a 2nd cell (used during stake/unstake)\\n * - 112 bit allows for 10^15 eth\\n * - 48 bit for full timestamp\\n * - 32 bit allows 150 years for unstake delay\\n */\\n struct DepositInfo {\\n uint256 deposit;\\n bool staked;\\n uint112 stake;\\n uint32 unstakeDelaySec;\\n uint48 withdrawTime;\\n }\\n\\n // API struct used by getStakeInfo and simulateValidation.\\n struct StakeInfo {\\n uint256 stake;\\n uint256 unstakeDelaySec;\\n }\\n\\n /**\\n * Get deposit info.\\n * @param account - The account to query.\\n * @return info - Full deposit information of given account.\\n */\\n function getDepositInfo(\\n address account\\n ) external view returns (DepositInfo memory info);\\n\\n /**\\n * Get account balance.\\n * @param account - The account to query.\\n * @return - The deposit (for gas payment) of the account.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * Add to the deposit of the given account.\\n * @param account - The account to add to.\\n */\\n function depositTo(address account) external payable;\\n\\n /**\\n * Add to the account's stake - amount and delay\\n * any pending unstake is first cancelled.\\n * @param _unstakeDelaySec - The new lock duration before the deposit can be withdrawn.\\n */\\n function addStake(uint32 _unstakeDelaySec) external payable;\\n\\n /**\\n * Attempt to unlock the stake.\\n * The value can be withdrawn (using withdrawStake) after the unstake delay.\\n */\\n function unlockStake() external;\\n\\n /**\\n * Withdraw from the (unlocked) stake.\\n * Must first call unlockStake and wait for the unstakeDelay to pass.\\n * @param withdrawAddress - The address to send withdrawn value.\\n */\\n function withdrawStake(address payable withdrawAddress) external;\\n\\n /**\\n * Withdraw from the deposit.\\n * @param withdrawAddress - The address to send withdrawn value.\\n * @param withdrawAmount - The amount to withdraw.\\n */\\n function withdrawTo(\\n address payable withdrawAddress,\\n uint256 withdrawAmount\\n ) external;\\n}\\n\",\"keccak256\":\"0xbe5ca9e7f254d031687419e7b96ef48c9c63e9398bbe992dc72ffc6dc14e0a04\",\"license\":\"GPL-3.0-only\"},\"@account-abstraction/contracts/interfaces/PackedUserOperation.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity >=0.7.5;\\n\\n/**\\n * User Operation struct\\n * @param sender - The sender account of this request.\\n * @param nonce - Unique value the sender uses to verify it is not a replay.\\n * @param initCode - If set, the account contract will be created by this constructor/\\n * @param callData - The method call to execute on this account.\\n * @param accountGasLimits - Packed gas limits for validateUserOp and gas limit passed to the callData method call.\\n * @param preVerificationGas - Gas not calculated by the handleOps method, but added to the gas paid.\\n * Covers batch overhead.\\n * @param gasFees - packed gas fields maxPriorityFeePerGas and maxFeePerGas - Same as EIP-1559 gas parameters.\\n * @param paymasterAndData - If set, this field holds the paymaster address, verification gas limit, postOp gas limit and paymaster-specific extra data\\n * The paymaster will pay for the transaction instead of the sender.\\n * @param signature - Sender-verified signature over the entire request, the EntryPoint address and the chain ID.\\n */\\nstruct PackedUserOperation {\\n address sender;\\n uint256 nonce;\\n bytes initCode;\\n bytes callData;\\n bytes32 accountGasLimits;\\n uint256 preVerificationGas;\\n bytes32 gasFees;\\n bytes paymasterAndData;\\n bytes signature;\\n}\\n\",\"keccak256\":\"0x1129b46381db68eddbc5cb49e50664667b66b03c480453858e7b25eabe444359\",\"license\":\"GPL-3.0\"},\"@account-abstraction/contracts/samples/callback/TokenCallbackHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable no-empty-blocks */\\n\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\\\";\\n\\n/**\\n * Token callback handler.\\n * Handles supported tokens' callbacks, allowing account receiving these tokens.\\n */\\nabstract contract TokenCallbackHandler is IERC721Receiver, IERC1155Receiver {\\n\\n function onERC721Received(\\n address,\\n address,\\n uint256,\\n bytes calldata\\n ) external pure override returns (bytes4) {\\n return IERC721Receiver.onERC721Received.selector;\\n }\\n\\n function onERC1155Received(\\n address,\\n address,\\n uint256,\\n uint256,\\n bytes calldata\\n ) external pure override returns (bytes4) {\\n return IERC1155Receiver.onERC1155Received.selector;\\n }\\n\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] calldata,\\n uint256[] calldata,\\n bytes calldata\\n ) external pure override returns (bytes4) {\\n return IERC1155Receiver.onERC1155BatchReceived.selector;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\\n return\\n interfaceId == type(IERC721Receiver).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x7770340a57c4be2b718b6ac2b031722074c0d795e0f4e1a6740ca1aa3d85e9d7\",\"license\":\"GPL-3.0\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0xb25a4f11fa80c702bf5cd85adec90e6f6f507f32f4a8e6f5dbc31e8c10029486\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xc42facb5094f2f35f066a7155bda23545e39a3156faef3ddc00185544443ba7d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Proxy} from \\\"../Proxy.sol\\\";\\nimport {ERC1967Utils} from \\\"./ERC1967Utils.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an\\n * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n *\\n * Requirements:\\n *\\n * - If `data` is empty, `msg.value` must be zero.\\n */\\n constructor(address implementation, bytes memory _data) payable {\\n ERC1967Utils.upgradeToAndCall(implementation, _data);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return ERC1967Utils.getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x0a8a5b994d4c4da9f61d128945cc8c9e60dcbc72bf532f72ae42a48ea90eed9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol)\\n\\npragma solidity ^0.8.21;\\n\\nimport {IBeacon} from \\\"../beacon/IBeacon.sol\\\";\\nimport {IERC1967} from \\\"../../interfaces/IERC1967.sol\\\";\\nimport {Address} from \\\"../../utils/Address.sol\\\";\\nimport {StorageSlot} from \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This library provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\\n */\\nlibrary ERC1967Utils {\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev The `implementation` of the proxy is invalid.\\n */\\n error ERC1967InvalidImplementation(address implementation);\\n\\n /**\\n * @dev The `admin` of the proxy is invalid.\\n */\\n error ERC1967InvalidAdmin(address admin);\\n\\n /**\\n * @dev The `beacon` of the proxy is invalid.\\n */\\n error ERC1967InvalidBeacon(address beacon);\\n\\n /**\\n * @dev An upgrade function sees `msg.value > 0` that may be lost.\\n */\\n error ERC1967NonPayable();\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the ERC-1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n if (newImplementation.code.length == 0) {\\n revert ERC1967InvalidImplementation(newImplementation);\\n }\\n StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Performs implementation upgrade with additional setup call if data is nonempty.\\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\\n * to avoid stuck value in the contract.\\n *\\n * Emits an {IERC1967-Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) internal {\\n _setImplementation(newImplementation);\\n emit IERC1967.Upgraded(newImplementation);\\n\\n if (data.length > 0) {\\n Address.functionDelegateCall(newImplementation, data);\\n } else {\\n _checkNonPayable();\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the ERC-1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n if (newAdmin == address(0)) {\\n revert ERC1967InvalidAdmin(address(0));\\n }\\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {IERC1967-AdminChanged} event.\\n */\\n function changeAdmin(address newAdmin) internal {\\n emit IERC1967.AdminChanged(getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.beacon\\\" subtracted by 1.\\n */\\n // solhint-disable-next-line private-vars-leading-underscore\\n bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the ERC-1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n if (newBeacon.code.length == 0) {\\n revert ERC1967InvalidBeacon(newBeacon);\\n }\\n\\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\\n\\n address beaconImplementation = IBeacon(newBeacon).implementation();\\n if (beaconImplementation.code.length == 0) {\\n revert ERC1967InvalidImplementation(beaconImplementation);\\n }\\n }\\n\\n /**\\n * @dev Change the beacon and trigger a setup call if data is nonempty.\\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\\n * to avoid stuck value in the contract.\\n *\\n * Emits an {IERC1967-BeaconUpgraded} event.\\n *\\n * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\\n * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\\n * efficiency.\\n */\\n function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\\n _setBeacon(newBeacon);\\n emit IERC1967.BeaconUpgraded(newBeacon);\\n\\n if (data.length > 0) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n } else {\\n _checkNonPayable();\\n }\\n }\\n\\n /**\\n * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\\n * if an upgrade doesn't perform an initialization call.\\n */\\n function _checkNonPayable() private {\\n if (msg.value > 0) {\\n revert ERC1967NonPayable();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x911c3346ee26afe188f3b9dc267ef62a7ccf940aba1afa963e3922f0ca3d8a06\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback\\n * function and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n}\\n\",\"keccak256\":\"0xc3f2ec76a3de8ed7a7007c46166f5550c72c7709e3fc7e8bb3111a7191cdedbd\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {UpgradeableBeacon} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc59a78b07b44b2cf2e8ab4175fca91e8eca1eee2df7357b8d2a8833e5ea1f64c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Storage of the initializable contract.\\n *\\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\\n * when using with upgradeable contracts.\\n *\\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\\n */\\n struct InitializableStorage {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint64 _initialized;\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool _initializing;\\n }\\n\\n // keccak256(abi.encode(uint256(keccak256(\\\"openzeppelin.storage.Initializable\\\")) - 1)) & ~bytes32(uint256(0xff))\\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\\n\\n /**\\n * @dev The contract is already initialized.\\n */\\n error InvalidInitialization();\\n\\n /**\\n * @dev The contract is not initializing.\\n */\\n error NotInitializing();\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint64 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\\n * production.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n // Cache values to avoid duplicated sloads\\n bool isTopLevelCall = !$._initializing;\\n uint64 initialized = $._initialized;\\n\\n // Allowed calls:\\n // - initialSetup: the contract is not in the initializing state and no previous version was\\n // initialized\\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\\n // current contract is just being deployed\\n bool initialSetup = initialized == 0 && isTopLevelCall;\\n bool construction = initialized == 1 && address(this).code.length == 0;\\n\\n if (!initialSetup && !construction) {\\n revert InvalidInitialization();\\n }\\n $._initialized = 1;\\n if (isTopLevelCall) {\\n $._initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n $._initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint64 version) {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing || $._initialized >= version) {\\n revert InvalidInitialization();\\n }\\n $._initialized = version;\\n $._initializing = true;\\n _;\\n $._initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n _checkInitializing();\\n _;\\n }\\n\\n /**\\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\\n */\\n function _checkInitializing() internal view virtual {\\n if (!_isInitializing()) {\\n revert NotInitializing();\\n }\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n // solhint-disable-next-line var-name-mixedcase\\n InitializableStorage storage $ = _getInitializableStorage();\\n\\n if ($._initializing) {\\n revert InvalidInitialization();\\n }\\n if ($._initialized != type(uint64).max) {\\n $._initialized = type(uint64).max;\\n emit Initialized(type(uint64).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint64) {\\n return _getInitializableStorage()._initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _getInitializableStorage()._initializing;\\n }\\n\\n /**\\n * @dev Returns a pointer to the storage namespace.\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\\n assembly {\\n $.slot := INITIALIZABLE_STORAGE\\n }\\n }\\n}\\n\",\"keccak256\":\"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC1822Proxiable} from \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport {ERC1967Utils} from \\\"../ERC1967/ERC1967Utils.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n */\\nabstract contract UUPSUpgradeable is IERC1822Proxiable {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\\n * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\\n * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\\n * If the getter returns `\\\"5.0.0\\\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\\n * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\\n * during an upgrade.\\n */\\n string public constant UPGRADE_INTERFACE_VERSION = \\\"5.0.0\\\";\\n\\n /**\\n * @dev The call is from an unauthorized context.\\n */\\n error UUPSUnauthorizedCallContext();\\n\\n /**\\n * @dev The storage `slot` is unsupported as a UUID.\\n */\\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n _checkProxy();\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n _checkNotDelegated();\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual notDelegated returns (bytes32) {\\n return ERC1967Utils.IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n *\\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data);\\n }\\n\\n /**\\n * @dev Reverts if the execution is not performed via delegatecall or the execution\\n * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\\n * See {_onlyProxy}.\\n */\\n function _checkProxy() internal view virtual {\\n if (\\n address(this) == __self || // Must be called through delegatecall\\n ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\\n ) {\\n revert UUPSUnauthorizedCallContext();\\n }\\n }\\n\\n /**\\n * @dev Reverts if the execution is performed via delegatecall.\\n * See {notDelegated}.\\n */\\n function _checkNotDelegated() internal view virtual {\\n if (address(this) != __self) {\\n // Must not be called through delegatecall\\n revert UUPSUnauthorizedCallContext();\\n }\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\\n *\\n * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\\n * is expected to be the implementation slot in ERC-1967.\\n *\\n * Emits an {IERC1967-Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\\n revert UUPSUnsupportedProxiableUUID(slot);\\n }\\n ERC1967Utils.upgradeToAndCall(newImplementation, data);\\n } catch {\\n // The implementation is not UUPS\\n revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb3f8fb5dc1c423373e346c4eccd6dc74ed858d70d58fb35cb721d1c56ca19bdf\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Create2.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev There's no code to deploy.\\n */\\n error Create2EmptyBytecode();\\n\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n if (bytecode.length == 0) {\\n revert Create2EmptyBytecode();\\n }\\n assembly (\\\"memory-safe\\\") {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n // if no address was created, and returndata is not empty, bubble revert\\n if and(iszero(addr), not(iszero(returndatasize()))) {\\n let p := mload(0x40)\\n returndatacopy(p, 0, returndatasize())\\n revert(p, returndatasize())\\n }\\n }\\n if (addr == address(0)) {\\n revert Errors.FailedDeployment();\\n }\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40) // Get free memory pointer\\n\\n // | | \\u2193 ptr ... \\u2193 ptr + 0x0B (start) ... \\u2193 ptr + 0x20 ... \\u2193 ptr + 0x40 ... |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\\n // | salt | BBBBBBBBBBBBB...BB |\\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\\n // | 0xFF | FF |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\\n // | keccak(start, 85) | \\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191 |\\n\\n mstore(add(ptr, 0x40), bytecodeHash)\\n mstore(add(ptr, 0x20), salt)\\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\\n mstore8(start, 0xff)\\n addr := and(keccak256(start, 85), 0xffffffffffffffffffffffffffffffffffffffff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xbb7e8401583d26268ea9103013bcdcd90866a7718bd91105ebd21c9bf11f4f06\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value)));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n uint256 localValue = value;\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\\n * representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS\\n }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n assembly (\\\"memory-safe\\\") {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS, s);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"contracts/PublicKeyRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity ^0.8.27;\\n\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract PublicKeyRegistry is Ownable(msg.sender) {\\n /// providerId => publicKeyHash => isValid\\n mapping(bytes32 => mapping(bytes32 => bool)) public isPublicKeyHashValid;\\n\\n function setPublicKeyValid(\\n bytes32 providerId,\\n bytes32 publicKeyHash,\\n bool valid\\n ) external onlyOwner {\\n isPublicKeyHashValid[providerId][publicKeyHash] = valid;\\n }\\n\\n struct PublicKeyValidity {\\n bytes32 providerId;\\n bytes32 publicKeyHash;\\n bool valid;\\n }\\n\\n function setPublicKeysValid(\\n PublicKeyValidity[] calldata validity\\n ) external onlyOwner {\\n for (uint256 i = 0; i < validity.length; i++) {\\n PublicKeyValidity calldata v = validity[i];\\n isPublicKeyHashValid[v.providerId][v.publicKeyHash] = v.valid;\\n }\\n }\\n\\n function checkPublicKey(\\n bytes32 providerId,\\n bytes32 publicKeyHash\\n ) external view returns (bool) {\\n return isPublicKeyHashValid[providerId][publicKeyHash];\\n }\\n}\\n\",\"keccak256\":\"0x49e25ad2c49b24f9fa828b12fa5bc1df386dfc1e6311cc680efb7366292ec0c9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/SimpleAccount.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\n/* solhint-disable avoid-low-level-calls */\\n/* solhint-disable no-inline-assembly */\\n/* solhint-disable reason-string */\\n\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@account-abstraction/contracts/core/BaseAccount.sol\\\";\\nimport \\\"@account-abstraction/contracts/core/Helpers.sol\\\";\\nimport \\\"@account-abstraction/contracts/samples/callback/TokenCallbackHandler.sol\\\";\\n\\nimport {PublicKeyRegistry} from \\\"./PublicKeyRegistry.sol\\\";\\nimport {ZkLogin} from \\\"./ZkLogin.sol\\\";\\n\\n// Note: keep in sync with JS\\n// How long owner session is valid for\\nuint96 constant OWNER_EXPIRATION_TIME = 24 hours;\\n\\n// Note: keep in sync with JS\\n// How long a jwt is valid for\\nuint256 constant JWT_EXPIRATION_TIME = 1 hours;\\n\\n/**\\n * minimal account.\\n * this is sample minimal account.\\n * has execute, eth handling methods\\n * has a single signer that can send requests through the entryPoint.\\n */\\ncontract SimpleAccount is\\n BaseAccount,\\n TokenCallbackHandler,\\n UUPSUpgradeable,\\n Initializable\\n{\\n IEntryPoint private immutable _entryPoint;\\n\\n struct Owner {\\n address owner;\\n uint96 expirationTimestamp;\\n }\\n Owner public ownerInfo;\\n\\n ZkLogin.AccountData public accountData;\\n\\n constructor(IEntryPoint anEntryPoint) {\\n _entryPoint = anEntryPoint;\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev The _entryPoint member is immutable, to reduce gas consumption. To upgrade EntryPoint,\\n * a new implementation of SimpleAccount must be deployed with the new EntryPoint address, then upgrading\\n * the implementation by calling `upgradeTo()`\\n */\\n function initialize(\\n ZkLogin.AccountData calldata accountData_\\n ) public virtual initializer {\\n accountData = accountData_;\\n }\\n\\n /// implement template method of BaseAccount\\n function _validateSignature(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash\\n ) internal virtual override returns (uint256 validationData) {\\n bytes32 hash = MessageHashUtils.toEthSignedMessageHash(userOpHash);\\n if (currentOwner() != ECDSA.recover(hash, userOp.signature))\\n return SIG_VALIDATION_FAILED;\\n return SIG_VALIDATION_SUCCESS;\\n }\\n\\n function validateUserOp(\\n PackedUserOperation calldata userOp,\\n bytes32 userOpHash,\\n uint256 missingAccountFunds\\n ) external virtual override returns (uint256 validationData) {\\n if (bytes4(userOp.callData) == this.setOwner.selector) {\\n // because it is a non-restricted function\\n return SIG_VALIDATION_SUCCESS;\\n }\\n\\n // copy-pasted from BaseAccount\\n _requireFromEntryPoint();\\n validationData = _validateSignature(userOp, userOpHash);\\n _validateNonce(userOp.nonce);\\n _payPrefund(missingAccountFunds);\\n }\\n\\n function currentOwner() public view returns (address) {\\n Owner memory ownerInfo_ = ownerInfo;\\n if (block.timestamp > ownerInfo_.expirationTimestamp) {\\n return address(0);\\n }\\n return ownerInfo_.owner;\\n }\\n\\n function setOwner(\\n ZkLogin.VerificationData calldata verificationData\\n ) public {\\n require(\\n verificationData.jwtIat + JWT_EXPIRATION_TIME >= block.timestamp,\\n \\\"JwtAccount: expired proof\\\"\\n );\\n bool result = ZkLogin.verifyProof(accountData, verificationData);\\n require(result, \\\"JwtAccount: invalid proof\\\");\\n\\n ownerInfo = Owner({\\n owner: address(uint160(uint256(verificationData.jwtNonce))),\\n expirationTimestamp: uint96(block.timestamp) + OWNER_EXPIRATION_TIME\\n });\\n }\\n\\n function _call(address target, uint256 value, bytes memory data) internal {\\n (bool success, bytes memory result) = target.call{value: value}(data);\\n if (!success) {\\n assembly {\\n revert(add(result, 32), mload(result))\\n }\\n }\\n }\\n\\n /**\\n * execute a transaction (called directly from owner, or by entryPoint)\\n * @param dest destination address to call\\n * @param value the value to pass in this call\\n * @param func the calldata to pass in this call\\n */\\n function execute(\\n address dest,\\n uint256 value,\\n bytes calldata func\\n ) external {\\n _requireFromEntryPointOrOwner();\\n _call(dest, value, func);\\n }\\n\\n /// @notice Represents a call to make.\\n struct Call {\\n /// @dev The address to call.\\n address target;\\n /// @dev The value to send when making the call.\\n uint256 value;\\n /// @dev The data of the call.\\n bytes data;\\n }\\n\\n /**\\n * execute a sequence of transactions\\n */\\n function executeBatch(Call[] calldata calls) external {\\n _requireFromEntryPointOrOwner();\\n for (uint256 i; i < calls.length; i++) {\\n _call(calls[i].target, calls[i].value, calls[i].data);\\n }\\n }\\n\\n /**\\n * check current account deposit in the entryPoint\\n */\\n function getDeposit() public view returns (uint256) {\\n return entryPoint().balanceOf(address(this));\\n }\\n\\n /**\\n * deposit more funds for this account in the entryPoint\\n */\\n function addDeposit() public payable {\\n entryPoint().depositTo{value: msg.value}(address(this));\\n }\\n\\n /**\\n * withdraw value from the account's deposit\\n * @param withdrawAddress target to send to\\n * @param amount to withdraw\\n */\\n function withdrawDepositTo(\\n address payable withdrawAddress,\\n uint256 amount\\n ) public onlyOwner {\\n entryPoint().withdrawTo(withdrawAddress, amount);\\n }\\n\\n // Require the function call went through EntryPoint or owner\\n function _requireFromEntryPointOrOwner() internal view {\\n require(\\n msg.sender == address(entryPoint()) || msg.sender == currentOwner(),\\n \\\"account: not Owner or EntryPoint\\\"\\n );\\n }\\n\\n /// @inheritdoc BaseAccount\\n function entryPoint() public view virtual override returns (IEntryPoint) {\\n return _entryPoint;\\n }\\n\\n modifier onlyOwner() {\\n _onlyOwner();\\n _;\\n }\\n\\n function _onlyOwner() internal view {\\n //directly from EOA owner, or through the account itself (which gets redirected through execute())\\n require(\\n msg.sender == currentOwner() || msg.sender == address(this),\\n \\\"only owner\\\"\\n );\\n }\\n\\n // solhint-disable-next-line no-empty-blocks\\n receive() external payable {}\\n\\n function _authorizeUpgrade(\\n address newImplementation\\n ) internal view override {\\n (newImplementation);\\n _onlyOwner();\\n }\\n}\\n\",\"keccak256\":\"0xe7c9a068a3cfb7575d5d9d9e2bb30002c7705c98de47c092d933d15d7db23baf\",\"license\":\"GPL-3.0\"},\"contracts/SimpleAccountFactory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\n\\nimport {SimpleAccount, IEntryPoint} from \\\"./SimpleAccount.sol\\\";\\nimport {PublicKeyRegistry} from \\\"./PublicKeyRegistry.sol\\\";\\nimport {ZkLogin} from \\\"./ZkLogin.sol\\\";\\n\\n/**\\n * A sample factory contract for SimpleAccount\\n * A UserOperations \\\"initCode\\\" holds the address of the factory, and a method call (to createAccount, in this sample factory).\\n * The factory's createAccount returns the target account address even if it is already installed.\\n * This way, the entryPoint.getSenderAddress() can be called either before or after the account is created.\\n */\\ncontract SimpleAccountFactory {\\n SimpleAccount public immutable accountImplementation;\\n\\n constructor(IEntryPoint _entryPoint) {\\n accountImplementation = new SimpleAccount(_entryPoint);\\n }\\n\\n /**\\n * create an account, and return its address.\\n * returns the address even if the account is already deployed.\\n * Note that during UserOperation execution, this method is called only if the account is not deployed.\\n * This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation\\n */\\n function createAccount(\\n ZkLogin.AccountData calldata params\\n ) public returns (SimpleAccount ret) {\\n // TODO: create2 address should depend only on accountId and jwt.aud (and maybe \\\"jwt.iss\\\"?)\\n ret = SimpleAccount(\\n payable(\\n new ERC1967Proxy{salt: bytes32(0)}(\\n address(accountImplementation),\\n abi.encodeCall(SimpleAccount.initialize, params)\\n )\\n )\\n );\\n }\\n\\n /**\\n * calculate the counterfactual address of this account as it would be returned by createAccount()\\n */\\n function getAccountAddress(\\n ZkLogin.AccountData calldata params\\n ) public view returns (address) {\\n return\\n Create2.computeAddress(\\n bytes32(0),\\n keccak256(\\n abi.encodePacked(\\n type(ERC1967Proxy).creationCode,\\n abi.encode(\\n address(accountImplementation),\\n abi.encodeCall(SimpleAccount.initialize, (params))\\n )\\n )\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xb9f88ff48f2bb143e26e072da63a0ee20ba38e788430ba16e4a07374f7366b76\",\"license\":\"GPL-3.0\"},\"contracts/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity ^0.8.27;\\n\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\n\\n function toHexStringWithoutPrefix(\\n uint256 value,\\n uint256 length\\n ) internal pure returns (string memory) {\\n uint256 localValue = value;\\n bytes memory buffer = new bytes(2 * length);\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i - 2] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\n return string(buffer);\\n }\\n\\n function toHexStringWithoutPrefix(\\n bytes32 value\\n ) internal pure returns (string memory) {\\n return toHexStringWithoutPrefix(uint256(value), 32);\\n }\\n}\\n\",\"keccak256\":\"0x71f8f11a2e7a84881a5ceb1cc52313d3e4e09b2e7ff6a09a0afb6dd7bc05651c\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/ZkLogin.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity ^0.8.27;\\n\\nimport {HonkVerifier} from \\\"../noir/target/jwt_account_honk.sol\\\";\\nimport {Strings} from \\\"./Strings.sol\\\";\\nimport {PublicKeyRegistry} from \\\"./PublicKeyRegistry.sol\\\";\\n\\nlibrary ZkLogin {\\n struct AccountData {\\n bytes32 accountId;\\n bytes32 authProviderId;\\n PublicKeyRegistry publicKeyRegistry;\\n HonkVerifier proofVerifier;\\n }\\n\\n struct VerificationData {\\n bytes proof;\\n uint256 jwtIat;\\n bytes32 jwtNonce;\\n bytes32 publicKeyHash;\\n }\\n\\n function verifyProof(\\n AccountData memory accountData,\\n VerificationData memory verificationData\\n ) internal view returns (bool) {\\n require(\\n accountData.publicKeyRegistry.checkPublicKey(\\n accountData.authProviderId,\\n verificationData.publicKeyHash\\n ),\\n \\\"public key hash mismatch\\\"\\n );\\n\\n bytes memory jwtNonce = bytes(\\n Strings.toHexStringWithoutPrefix(verificationData.jwtNonce)\\n );\\n\\n uint256 staticInputLength = 3;\\n bytes32[] memory publicInputs = new bytes32[](\\n staticInputLength + jwtNonce.length\\n );\\n uint256 j = 0;\\n publicInputs[j++] = accountData.accountId;\\n publicInputs[j++] = bytes32(verificationData.jwtIat);\\n publicInputs[j++] = verificationData.publicKeyHash;\\n\\n for (uint256 i = 0; i < jwtNonce.length; i++) {\\n publicInputs[j++] = bytes32(uint256(uint8(jwtNonce[i])));\\n }\\n\\n return\\n accountData.proofVerifier.verify(\\n verificationData.proof,\\n publicInputs\\n );\\n }\\n}\\n\",\"keccak256\":\"0xf8dc7528326d29d9a6ec030973993d9820b7760e30d8c6635eae504663928b20\",\"license\":\"SEE LICENSE IN LICENSE\"},\"noir/target/jwt_account_honk.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\n// Copyright 2022 Aztec\\npragma solidity >=0.8.21;\\n\\nuint256 constant N = 262144;\\nuint256 constant LOG_N = 18;\\nuint256 constant NUMBER_OF_PUBLIC_INPUTS = 67;\\nlibrary HonkVerificationKey {\\n function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) {\\n Honk.VerificationKey memory vk = Honk.VerificationKey({\\n circuitSize: uint256(262144),\\n logCircuitSize: uint256(18),\\n publicInputsSize: uint256(67),\\n ql: Honk.G1Point({ \\n x: uint256(0x128f4689193e8d7e352ac5f0afe29ff277d1b8b08807981784a590b82a9b5e2e),\\n y: uint256(0x1aa8be7d44f5bf4c12440bd390aeb102e211af54f0c176e5a7aaecdf49543574)\\n }),\\n qr: Honk.G1Point({ \\n x: uint256(0x2b0a33558c2603b6bc43635665be9da0f5e2f623bea9e22dd055c74324d7f122),\\n y: uint256(0x162d39578897a70f2dc851710de29d3dd6fae4e768f2c841aa7b95834ceae5cb)\\n }),\\n qo: Honk.G1Point({ \\n x: uint256(0x262d979b29df1669541daa3f02157701ff7ab07a6f5317d2e4d1c4c2106e17e3),\\n y: uint256(0x06af46ef2dc4282de259c7e02867c3c77a799af864e2370f61a8f1aec7a7f409)\\n }),\\n q4: Honk.G1Point({ \\n x: uint256(0x0e45f7edf0975574a0234a5c0510af9251c52534b527f8af7bd17a4c60959096),\\n y: uint256(0x2053c39f8961e378924eb488270ae9caab9db0bbf2d2937c0fef89a40000d214)\\n }),\\n qm: Honk.G1Point({ \\n x: uint256(0x0000000000000000000000000000000000000000000000000000000000000000),\\n y: uint256(0x0000000000000000000000000000000000000000000000000000000000000000)\\n }),\\n qc: Honk.G1Point({ \\n x: uint256(0x0023296072ba882e23ed90ee1dac8eedbb30e5b4fbbf6a8be14cc97eaa446693),\\n y: uint256(0x1540513d0b8971ae7c56b28838a830801b04cc4f3a3dde06c3eac3410a2ee9c4)\\n }),\\n qArith: Honk.G1Point({ \\n x: uint256(0x24792fa51f5beafb9c4eff1a8bf1a9a6ccd9a02877d64ec78becc03bc9f7d1ff),\\n y: uint256(0x2b3a9b5ddd9cf49b41974c5cb73e39997fd915a8df5b8458fa08d02a55a96443)\\n }),\\n qDeltaRange: Honk.G1Point({ \\n x: uint256(0x1df1862c3cd967cf4e80a289e6fec969049ae11aac5a796ac650315d22e580fb),\\n y: uint256(0x2afb83456939046324306525332ef3307638d6766ff90e40559aa45e471b871b)\\n }),\\n qElliptic: Honk.G1Point({ \\n x: uint256(0x286ee766413caa93518a7570875801a9159d2e1315c1ab5bc9e52595a830c495),\\n y: uint256(0x045175bd839a41eda5e9b6a40f76bbbf2723a68e1e7ecd739bd97ae093cd6528)\\n }),\\n qAux: Honk.G1Point({ \\n x: uint256(0x1c2f84adf95896cf0018ae79ebbdeb2468b1404953a855ec2facc4b494495433),\\n y: uint256(0x0a175b5ba1452877e6cb7ac6ca850788f7e17a56f310cb5f18d9642b7bdcbcf2)\\n }),\\n qLookup: Honk.G1Point({ \\n x: uint256(0x22ffd03e53836f0a9271398e34a792953979926b49a76c967c71cc8af35e04bb),\\n y: uint256(0x02e2ae071779429f971820e5d680764ae55b0a0db4bc14709d47abc261cfe64c)\\n }),\\n qPoseidon2External: Honk.G1Point({ \\n x: uint256(0x034ab86a5bccfa4f69637da232ba777f403c1aeb69ad6040d432a795e1b382c2),\\n y: uint256(0x09a353e2a34ad0af28688dbf4c01cc7de2c9878d6a1b80ce58e567d6c48b5bec)\\n }),\\n qPoseidon2Internal: Honk.G1Point({ \\n x: uint256(0x1a65519a1ab82173d9cb9dc061f62c9d53ef95915b0cc76feb9feb90351e810d),\\n y: uint256(0x29c0afd9c7eeae8e1635b3835090d59d5344bd56cf3c71487adcf6d8c5844348)\\n }),\\n s1: Honk.G1Point({ \\n x: uint256(0x139c2f5bba86aea351df6608e3f1cd26b3c0b4371dca357e701a6025f94be1e7),\\n y: uint256(0x22399eb57ad19a4409a194335726da4d76a0cf2d0d89a50dbc7f687de1aad8c3)\\n }),\\n s2: Honk.G1Point({ \\n x: uint256(0x0ff16a5ae01ecffc7815eb75c174ad14281aa49059929907518634d841c628f5),\\n y: uint256(0x2d867f1d311969273bc82b184e63d9269b182a881d3b302b242a4dc93462f7b7)\\n }),\\n s3: Honk.G1Point({ \\n x: uint256(0x0821760c77fc15784afcaff815f73f8f90aa38ebe34d3b48695e3a6ad08ed8b0),\\n y: uint256(0x2f51bc8941e5c577f7ec1d5bb038bd902c7a5c7dd1389bab38b9c89ec4ab7d29)\\n }),\\n s4: Honk.G1Point({ \\n x: uint256(0x0ffd51787978d66be3b7e70e810c4575178c9f45674db1b870595ce7e2fb5f6f),\\n y: uint256(0x17a63d56e53061da2fe13b311859cb536d18d6060100c393c5bb9251dfbad74a)\\n }),\\n t1: Honk.G1Point({ \\n x: uint256(0x234c57b9aab8dfb66855cbb2ed5c7dcaa724527a8b5abae05dbfc771da6679cc),\\n y: uint256(0x22060d556338e2843aed696c8fc98bf0c6d133543b5c8774daf51221e0eafb44)\\n }),\\n t2: Honk.G1Point({ \\n x: uint256(0x2c931d2ddd0a37bf249ba13d4c0005dcf10f905b44f587692f7e19c4325beece),\\n y: uint256(0x02d3dc1f3ed31519bae6c333e090615800a04cfdc9d6233f823114a44746d501)\\n }),\\n t3: Honk.G1Point({ \\n x: uint256(0x06246fd4811f690574ddc55745590439a8f73455e78fdd3521d65c7e007e6b45),\\n y: uint256(0x1e132a30f5aa1d892595234280dd91b7728b3dadc7b72e58f2a95148f38ba210)\\n }),\\n t4: Honk.G1Point({ \\n x: uint256(0x1e0181f12b41a00b4ee891ed5a942bfdbae834b4faf95ce9e9aaa9bd2500ce63),\\n y: uint256(0x1b6f032aa6b07625de54649d25628c9a5c45ab7c6c13a88fdd31ca7ecce024af)\\n }),\\n id1: Honk.G1Point({ \\n x: uint256(0x024dcf715a66fd964f629553ae2bcb51c127b813ed7f9a4b28b481fb9e2c3772),\\n y: uint256(0x20244a5d7222400941070d0355a58d34ab8ff9b0d8935fd8c9225059f13fcaac)\\n }),\\n id2: Honk.G1Point({ \\n x: uint256(0x02987fe7cdb3cab8ebf18ecc8711b792828a0670bd9bcd17442c4a157325c8ef),\\n y: uint256(0x1c9fa626c623b3102d77b2878a9de76dd9a1837521baa49c6874797a8e5a9626)\\n }),\\n id3: Honk.G1Point({ \\n x: uint256(0x130b070560870337eb165683645e3c8522d6449e1367a35c5cf00dd4462fd967),\\n y: uint256(0x01fe23c3926178b337c362c53b74d2233d08cf587bb0f114ebfe21542c9645e5)\\n }),\\n id4: Honk.G1Point({ \\n x: uint256(0x153a7f8639e06461474e00018cde1ac1acf38089893c5515de20804922c03219),\\n y: uint256(0x0939c3d22ab03cefb504fe214af93d65912ae3750ce6b756b0e02c9ce7a16e68)\\n }),\\n lagrangeFirst: Honk.G1Point({ \\n x: uint256(0x19b09aa2fcb34ae480845aa4ad56e01616ae845300e6f676fdb84f4bd396851b),\\n y: uint256(0x295d8a6bfcce573b23d5eefd0aab6d32479423acd4956ce6deb5a67073f032d5)\\n }),\\n lagrangeLast: Honk.G1Point({ \\n x: uint256(0x08d314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b),\\n y: uint256(0x0100000000000000000000000000000000000000000000000000000000000000)\\n })\\n });\\n return vk;\\n }\\n}\\n\\npragma solidity ^0.8.27;\\n\\ntype Fr is uint256;\\n\\nusing { add as + } for Fr global;\\nusing { sub as - } for Fr global;\\nusing { mul as * } for Fr global;\\nusing { exp as ^ } for Fr global;\\nusing { notEqual as != } for Fr global;\\nusing { equal as == } for Fr global;\\n\\nuint256 constant MODULUS =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617; // Prime field order\\n\\nFr constant MINUS_ONE = Fr.wrap(MODULUS - 1);\\n\\n// Instantiation\\nlibrary FrLib\\n{\\n function from(uint256 value) internal pure returns(Fr)\\n {\\n return Fr.wrap(value % MODULUS);\\n }\\n\\n function fromBytes32(bytes32 value) internal pure returns(Fr)\\n {\\n return Fr.wrap(uint256(value) % MODULUS);\\n }\\n\\n function toBytes32(Fr value) internal pure returns(bytes32)\\n {\\n return bytes32(Fr.unwrap(value));\\n }\\n\\n function invert(Fr value) internal view returns(Fr)\\n {\\n uint256 v = Fr.unwrap(value);\\n uint256 result;\\n\\n // Call the modexp precompile to invert in the field\\n assembly\\n {\\n let free := mload(0x40)\\n mstore(free, 0x20)\\n mstore(add(free, 0x20), 0x20)\\n mstore(add(free, 0x40), 0x20)\\n mstore(add(free, 0x60), v)\\n mstore(add(free, 0x80), sub(MODULUS, 2))\\n mstore(add(free, 0xa0), MODULUS)\\n let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)\\n if iszero(success) {\\n revert(0, 0)\\n }\\n result := mload(0x00)\\n }\\n\\n return Fr.wrap(result);\\n }\\n\\n function pow(Fr base, uint256 v) internal view returns(Fr)\\n {\\n uint256 b = Fr.unwrap(base);\\n uint256 result;\\n\\n // Call the modexp precompile to invert in the field\\n assembly\\n {\\n let free := mload(0x40)\\n mstore(free, 0x20)\\n mstore(add(free, 0x20), 0x20)\\n mstore(add(free, 0x40), 0x20)\\n mstore(add(free, 0x60), b)\\n mstore(add(free, 0x80), v)\\n mstore(add(free, 0xa0), MODULUS)\\n let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)\\n if iszero(success) {\\n revert(0, 0)\\n }\\n result := mload(0x00)\\n }\\n\\n return Fr.wrap(result);\\n }\\n\\n function div(Fr numerator, Fr denominator) internal view returns(Fr)\\n {\\n return numerator * invert(denominator);\\n }\\n\\n function sqr(Fr value) internal pure returns (Fr) {\\n return value * value;\\n }\\n\\n function unwrap(Fr value) internal pure returns (uint256) {\\n return Fr.unwrap(value);\\n }\\n\\n function neg(Fr value) internal pure returns (Fr) {\\n return Fr.wrap(MODULUS - Fr.unwrap(value));\\n }\\n}\\n\\n// Free functions\\nfunction add(Fr a, Fr b) pure returns(Fr)\\n{\\n return Fr.wrap(addmod(Fr.unwrap(a), Fr.unwrap(b), MODULUS));\\n}\\n\\nfunction mul(Fr a, Fr b) pure returns(Fr)\\n{\\n return Fr.wrap(mulmod(Fr.unwrap(a), Fr.unwrap(b), MODULUS));\\n}\\n\\nfunction sub(Fr a, Fr b) pure returns(Fr)\\n{\\n return Fr.wrap(addmod(Fr.unwrap(a), MODULUS - Fr.unwrap(b), MODULUS));\\n}\\n\\nfunction exp(Fr base, Fr exponent) pure returns(Fr)\\n{\\n if (Fr.unwrap(exponent) == 0) return Fr.wrap(1);\\n\\n for (uint256 i = 1; i < Fr.unwrap(exponent); i += i) {\\n base = base * base;\\n }\\n return base;\\n}\\n\\nfunction notEqual(Fr a, Fr b) pure returns(bool)\\n{\\n return Fr.unwrap(a) != Fr.unwrap(b);\\n}\\n\\nfunction equal(Fr a, Fr b) pure returns(bool)\\n{\\n return Fr.unwrap(a) == Fr.unwrap(b);\\n}\\n\\nuint256 constant CONST_PROOF_SIZE_LOG_N = 28;\\n\\nuint256 constant NUMBER_OF_SUBRELATIONS = 26;\\nuint256 constant BATCHED_RELATION_PARTIAL_LENGTH = 8;\\nuint256 constant NUMBER_OF_ENTITIES = 44;\\nuint256 constant NUMBER_UNSHIFTED = 35;\\nuint256 constant NUMBER_TO_BE_SHIFTED = 9;\\n\\n// Alphas are used as relation separators so there should be NUMBER_OF_SUBRELATIONS - 1\\nuint256 constant NUMBER_OF_ALPHAS = 25;\\n\\n// Prime field order\\nuint256 constant Q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; // EC group order. F_q\\nuint256 constant P = 21888242871839275222246405745257275088548364400416034343698204186575808495617; // Prime field order, F_r\\n\\n// ENUM FOR WIRES\\nenum WIRE {\\n Q_M,\\n Q_C,\\n Q_L,\\n Q_R,\\n Q_O,\\n Q_4,\\n Q_ARITH,\\n Q_RANGE,\\n Q_ELLIPTIC,\\n Q_AUX,\\n Q_LOOKUP,\\n Q_POSEIDON2_EXTERNAL,\\n Q_POSEIDON2_INTERNAL,\\n SIGMA_1,\\n SIGMA_2,\\n SIGMA_3,\\n SIGMA_4,\\n ID_1,\\n ID_2,\\n ID_3,\\n ID_4,\\n TABLE_1,\\n TABLE_2,\\n TABLE_3,\\n TABLE_4,\\n LAGRANGE_FIRST,\\n LAGRANGE_LAST,\\n W_L,\\n W_R,\\n W_O,\\n W_4,\\n Z_PERM,\\n LOOKUP_INVERSES,\\n LOOKUP_READ_COUNTS,\\n LOOKUP_READ_TAGS,\\n TABLE_1_SHIFT,\\n TABLE_2_SHIFT,\\n TABLE_3_SHIFT,\\n TABLE_4_SHIFT,\\n W_L_SHIFT,\\n W_R_SHIFT,\\n W_O_SHIFT,\\n W_4_SHIFT,\\n Z_PERM_SHIFT\\n}\\n\\nlibrary Honk {\\n struct G1Point {\\n uint256 x;\\n uint256 y;\\n }\\n\\n struct G1ProofPoint {\\n uint256 x_0;\\n uint256 x_1;\\n uint256 y_0;\\n uint256 y_1;\\n }\\n\\n struct VerificationKey {\\n // Misc Params\\n uint256 circuitSize;\\n uint256 logCircuitSize;\\n uint256 publicInputsSize;\\n // Selectors\\n G1Point qm;\\n G1Point qc;\\n G1Point ql;\\n G1Point qr;\\n G1Point qo;\\n G1Point q4;\\n G1Point qArith; // Arithmetic widget\\n G1Point qDeltaRange; // Delta Range sort\\n G1Point qAux; // Auxillary\\n G1Point qElliptic; // Auxillary\\n G1Point qLookup; // Lookup\\n G1Point qPoseidon2External;\\n G1Point qPoseidon2Internal;\\n // Copy cnstraints\\n G1Point s1;\\n G1Point s2;\\n G1Point s3;\\n G1Point s4;\\n // Copy identity\\n G1Point id1;\\n G1Point id2;\\n G1Point id3;\\n G1Point id4;\\n // Precomputed lookup table\\n G1Point t1;\\n G1Point t2;\\n G1Point t3;\\n G1Point t4;\\n // Fixed first and last\\n G1Point lagrangeFirst;\\n G1Point lagrangeLast;\\n }\\n\\n struct Proof {\\n uint256 circuitSize;\\n uint256 publicInputsSize;\\n uint256 publicInputsOffset;\\n // Free wires\\n Honk.G1ProofPoint w1;\\n Honk.G1ProofPoint w2;\\n Honk.G1ProofPoint w3;\\n Honk.G1ProofPoint w4;\\n // Lookup helpers - Permutations\\n Honk.G1ProofPoint zPerm;\\n // Lookup helpers - logup\\n Honk.G1ProofPoint lookupReadCounts;\\n Honk.G1ProofPoint lookupReadTags;\\n Honk.G1ProofPoint lookupInverses;\\n // Sumcheck\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH][CONST_PROOF_SIZE_LOG_N] sumcheckUnivariates;\\n Fr[NUMBER_OF_ENTITIES] sumcheckEvaluations;\\n // Shplemini\\n Honk.G1ProofPoint[CONST_PROOF_SIZE_LOG_N - 1] geminiFoldComms;\\n Fr[CONST_PROOF_SIZE_LOG_N] geminiAEvaluations;\\n Honk.G1ProofPoint shplonkQ;\\n Honk.G1ProofPoint kzgQuotient;\\n }\\n}\\n\\n\\n// Transcript library to generate fiat shamir challenges\\nstruct Transcript {\\n Fr eta;\\n Fr etaTwo;\\n Fr etaThree;\\n Fr beta;\\n Fr gamma;\\n Fr[NUMBER_OF_ALPHAS] alphas;\\n Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges;\\n Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges;\\n // Shplemini\\n Fr rho;\\n Fr geminiR;\\n Fr shplonkNu;\\n Fr shplonkZ;\\n // Derived\\n Fr publicInputsDelta;\\n}\\n\\nlibrary TranscriptLib {\\n function generateTranscript(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize)\\n internal\\n pure\\n returns (Transcript memory t)\\n {\\n Fr previousChallenge;\\n (t.eta, t.etaTwo, t.etaThree, previousChallenge) = generateEtaChallenge(proof, publicInputs, publicInputsSize);\\n\\n (t.beta, t.gamma, previousChallenge) = generateBetaAndGammaChallenges(previousChallenge, proof);\\n\\n (t.alphas, previousChallenge) = generateAlphaChallenges(previousChallenge, proof);\\n\\n (t.gateChallenges, previousChallenge) = generateGateChallenges(previousChallenge);\\n\\n (t.sumCheckUChallenges, previousChallenge) = generateSumcheckChallenges(proof, previousChallenge);\\n\\n (t.rho, previousChallenge) = generateRhoChallenge(proof, previousChallenge);\\n\\n (t.geminiR, previousChallenge) = generateGeminiRChallenge(proof, previousChallenge);\\n\\n (t.shplonkNu, previousChallenge) = generateShplonkNuChallenge(proof, previousChallenge);\\n\\n (t.shplonkZ, previousChallenge) = generateShplonkZChallenge(proof, previousChallenge);\\n\\n return t;\\n }\\n\\n function splitChallenge(Fr challenge) internal pure returns (Fr first, Fr second) {\\n uint256 challengeU256 = uint256(Fr.unwrap(challenge));\\n uint256 lo = challengeU256 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;\\n uint256 hi = challengeU256 >> 128;\\n first = FrLib.fromBytes32(bytes32(lo));\\n second = FrLib.fromBytes32(bytes32(hi));\\n }\\n\\n function generateEtaChallenge(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize)\\n internal\\n pure\\n returns (Fr eta, Fr etaTwo, Fr etaThree, Fr previousChallenge)\\n {\\n bytes32[] memory round0 = new bytes32[](3 + publicInputsSize + 12);\\n round0[0] = bytes32(proof.circuitSize);\\n round0[1] = bytes32(proof.publicInputsSize);\\n round0[2] = bytes32(proof.publicInputsOffset);\\n for (uint256 i = 0; i < publicInputsSize; i++) {\\n round0[3 + i] = bytes32(publicInputs[i]);\\n }\\n\\n // Create the first challenge\\n // Note: w4 is added to the challenge later on\\n round0[3 + publicInputsSize] = bytes32(proof.w1.x_0);\\n round0[3 + publicInputsSize + 1] = bytes32(proof.w1.x_1);\\n round0[3 + publicInputsSize + 2] = bytes32(proof.w1.y_0);\\n round0[3 + publicInputsSize + 3] = bytes32(proof.w1.y_1);\\n round0[3 + publicInputsSize + 4] = bytes32(proof.w2.x_0);\\n round0[3 + publicInputsSize + 5] = bytes32(proof.w2.x_1);\\n round0[3 + publicInputsSize + 6] = bytes32(proof.w2.y_0);\\n round0[3 + publicInputsSize + 7] = bytes32(proof.w2.y_1);\\n round0[3 + publicInputsSize + 8] = bytes32(proof.w3.x_0);\\n round0[3 + publicInputsSize + 9] = bytes32(proof.w3.x_1);\\n round0[3 + publicInputsSize + 10] = bytes32(proof.w3.y_0);\\n round0[3 + publicInputsSize + 11] = bytes32(proof.w3.y_1);\\n\\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(round0)));\\n (eta, etaTwo) = splitChallenge(previousChallenge);\\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge))));\\n Fr unused;\\n (etaThree, unused) = splitChallenge(previousChallenge);\\n }\\n\\n function generateBetaAndGammaChallenges(Fr previousChallenge, Honk.Proof memory proof)\\n internal\\n pure\\n returns (Fr beta, Fr gamma, Fr nextPreviousChallenge)\\n {\\n bytes32[13] memory round1;\\n round1[0] = FrLib.toBytes32(previousChallenge);\\n round1[1] = bytes32(proof.lookupReadCounts.x_0);\\n round1[2] = bytes32(proof.lookupReadCounts.x_1);\\n round1[3] = bytes32(proof.lookupReadCounts.y_0);\\n round1[4] = bytes32(proof.lookupReadCounts.y_1);\\n round1[5] = bytes32(proof.lookupReadTags.x_0);\\n round1[6] = bytes32(proof.lookupReadTags.x_1);\\n round1[7] = bytes32(proof.lookupReadTags.y_0);\\n round1[8] = bytes32(proof.lookupReadTags.y_1);\\n round1[9] = bytes32(proof.w4.x_0);\\n round1[10] = bytes32(proof.w4.x_1);\\n round1[11] = bytes32(proof.w4.y_0);\\n round1[12] = bytes32(proof.w4.y_1);\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(round1)));\\n (beta, gamma) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n // Alpha challenges non-linearise the gate contributions\\n function generateAlphaChallenges(Fr previousChallenge, Honk.Proof memory proof)\\n internal\\n pure\\n returns (Fr[NUMBER_OF_ALPHAS] memory alphas, Fr nextPreviousChallenge)\\n {\\n // Generate the original sumcheck alpha 0 by hashing zPerm and zLookup\\n uint256[9] memory alpha0;\\n alpha0[0] = Fr.unwrap(previousChallenge);\\n alpha0[1] = proof.lookupInverses.x_0;\\n alpha0[2] = proof.lookupInverses.x_1;\\n alpha0[3] = proof.lookupInverses.y_0;\\n alpha0[4] = proof.lookupInverses.y_1;\\n alpha0[5] = proof.zPerm.x_0;\\n alpha0[6] = proof.zPerm.x_1;\\n alpha0[7] = proof.zPerm.y_0;\\n alpha0[8] = proof.zPerm.y_1;\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(alpha0)));\\n (alphas[0], alphas[1]) = splitChallenge(nextPreviousChallenge);\\n\\n for (uint256 i = 1; i < NUMBER_OF_ALPHAS / 2; i++) {\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(nextPreviousChallenge))));\\n (alphas[2 * i], alphas[2 * i + 1]) = splitChallenge(nextPreviousChallenge);\\n }\\n if (((NUMBER_OF_ALPHAS & 1) == 1) && (NUMBER_OF_ALPHAS > 2)) {\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(nextPreviousChallenge))));\\n Fr unused;\\n (alphas[NUMBER_OF_ALPHAS - 1], unused) = splitChallenge(nextPreviousChallenge);\\n }\\n }\\n\\n function generateGateChallenges(Fr previousChallenge)\\n internal\\n pure\\n returns (Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges, Fr nextPreviousChallenge)\\n {\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge))));\\n Fr unused;\\n (gateChallenges[i], unused) = splitChallenge(previousChallenge);\\n }\\n nextPreviousChallenge = previousChallenge;\\n }\\n\\n function generateSumcheckChallenges(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr[CONST_PROOF_SIZE_LOG_N] memory sumcheckChallenges, Fr nextPreviousChallenge)\\n {\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH + 1] memory univariateChal;\\n univariateChal[0] = prevChallenge;\\n\\n for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) {\\n univariateChal[j + 1] = proof.sumcheckUnivariates[i][j];\\n }\\n prevChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(univariateChal)));\\n Fr unused;\\n (sumcheckChallenges[i], unused) = splitChallenge(prevChallenge);\\n }\\n nextPreviousChallenge = prevChallenge;\\n }\\n\\n function generateRhoChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr rho, Fr nextPreviousChallenge)\\n {\\n Fr[NUMBER_OF_ENTITIES + 1] memory rhoChallengeElements;\\n rhoChallengeElements[0] = prevChallenge;\\n\\n for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) {\\n rhoChallengeElements[i + 1] = proof.sumcheckEvaluations[i];\\n }\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(rhoChallengeElements)));\\n Fr unused;\\n (rho, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function generateGeminiRChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr geminiR, Fr nextPreviousChallenge)\\n {\\n uint256[(CONST_PROOF_SIZE_LOG_N - 1) * 4 + 1] memory gR;\\n gR[0] = Fr.unwrap(prevChallenge);\\n\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) {\\n gR[1 + i * 4] = proof.geminiFoldComms[i].x_0;\\n gR[2 + i * 4] = proof.geminiFoldComms[i].x_1;\\n gR[3 + i * 4] = proof.geminiFoldComms[i].y_0;\\n gR[4 + i * 4] = proof.geminiFoldComms[i].y_1;\\n }\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(gR)));\\n Fr unused;\\n (geminiR, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function generateShplonkNuChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr shplonkNu, Fr nextPreviousChallenge)\\n {\\n uint256[(CONST_PROOF_SIZE_LOG_N) + 1] memory shplonkNuChallengeElements;\\n shplonkNuChallengeElements[0] = Fr.unwrap(prevChallenge);\\n\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n shplonkNuChallengeElements[i + 1] = Fr.unwrap(proof.geminiAEvaluations[i]);\\n }\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(shplonkNuChallengeElements)));\\n Fr unused;\\n (shplonkNu, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function generateShplonkZChallenge(Honk.Proof memory proof, Fr prevChallenge)\\n internal\\n pure\\n returns (Fr shplonkZ, Fr nextPreviousChallenge)\\n {\\n uint256[5] memory shplonkZChallengeElements;\\n shplonkZChallengeElements[0] = Fr.unwrap(prevChallenge);\\n\\n shplonkZChallengeElements[1] = proof.shplonkQ.x_0;\\n shplonkZChallengeElements[2] = proof.shplonkQ.x_1;\\n shplonkZChallengeElements[3] = proof.shplonkQ.y_0;\\n shplonkZChallengeElements[4] = proof.shplonkQ.y_1;\\n\\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(shplonkZChallengeElements)));\\n Fr unused;\\n (shplonkZ, unused) = splitChallenge(nextPreviousChallenge);\\n }\\n\\n function loadProof(bytes calldata proof) internal pure returns (Honk.Proof memory) {\\n Honk.Proof memory p;\\n\\n // Metadata\\n p.circuitSize = uint256(bytes32(proof[0x00:0x20]));\\n p.publicInputsSize = uint256(bytes32(proof[0x20:0x40]));\\n p.publicInputsOffset = uint256(bytes32(proof[0x40:0x60]));\\n\\n // Commitments\\n p.w1 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x60:0x80])),\\n x_1: uint256(bytes32(proof[0x80:0xa0])),\\n y_0: uint256(bytes32(proof[0xa0:0xc0])),\\n y_1: uint256(bytes32(proof[0xc0:0xe0]))\\n });\\n\\n p.w2 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0xe0:0x100])),\\n x_1: uint256(bytes32(proof[0x100:0x120])),\\n y_0: uint256(bytes32(proof[0x120:0x140])),\\n y_1: uint256(bytes32(proof[0x140:0x160]))\\n });\\n p.w3 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x160:0x180])),\\n x_1: uint256(bytes32(proof[0x180:0x1a0])),\\n y_0: uint256(bytes32(proof[0x1a0:0x1c0])),\\n y_1: uint256(bytes32(proof[0x1c0:0x1e0]))\\n });\\n\\n // Lookup / Permutation Helper Commitments\\n p.lookupReadCounts = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x1e0:0x200])),\\n x_1: uint256(bytes32(proof[0x200:0x220])),\\n y_0: uint256(bytes32(proof[0x220:0x240])),\\n y_1: uint256(bytes32(proof[0x240:0x260]))\\n });\\n p.lookupReadTags = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x260:0x280])),\\n x_1: uint256(bytes32(proof[0x280:0x2a0])),\\n y_0: uint256(bytes32(proof[0x2a0:0x2c0])),\\n y_1: uint256(bytes32(proof[0x2c0:0x2e0]))\\n });\\n p.w4 = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x2e0:0x300])),\\n x_1: uint256(bytes32(proof[0x300:0x320])),\\n y_0: uint256(bytes32(proof[0x320:0x340])),\\n y_1: uint256(bytes32(proof[0x340:0x360]))\\n });\\n p.lookupInverses = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x360:0x380])),\\n x_1: uint256(bytes32(proof[0x380:0x3a0])),\\n y_0: uint256(bytes32(proof[0x3a0:0x3c0])),\\n y_1: uint256(bytes32(proof[0x3c0:0x3e0]))\\n });\\n p.zPerm = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[0x3e0:0x400])),\\n x_1: uint256(bytes32(proof[0x400:0x420])),\\n y_0: uint256(bytes32(proof[0x420:0x440])),\\n y_1: uint256(bytes32(proof[0x440:0x460]))\\n });\\n\\n // Boundary represents a pointer to the head of the unread part of the proof\\n uint256 boundary = 0x460;\\n\\n // Sumcheck univariates\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n // The loop boundary of i, this will shift forward on each evaluation\\n uint256 loop_boundary = boundary + (i * 0x20 * BATCHED_RELATION_PARTIAL_LENGTH);\\n\\n for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) {\\n uint256 start = loop_boundary + (j * 0x20);\\n uint256 end = start + 0x20;\\n p.sumcheckUnivariates[i][j] = FrLib.fromBytes32(bytes32(proof[start:end]));\\n }\\n }\\n\\n boundary = boundary + (CONST_PROOF_SIZE_LOG_N * BATCHED_RELATION_PARTIAL_LENGTH * 0x20);\\n // Sumcheck evaluations\\n for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) {\\n uint256 start = boundary + (i * 0x20);\\n uint256 end = start + 0x20;\\n p.sumcheckEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end]));\\n }\\n\\n boundary = boundary + (NUMBER_OF_ENTITIES * 0x20);\\n\\n // Gemini\\n // Read gemini fold univariates\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) {\\n uint256 xStart = boundary + (i * 0x80);\\n uint256 xEnd = xStart + 0x20;\\n\\n uint256 x1Start = xEnd;\\n uint256 x1End = x1Start + 0x20;\\n\\n uint256 yStart = x1End;\\n uint256 yEnd = yStart + 0x20;\\n\\n uint256 y1Start = yEnd;\\n uint256 y1End = y1Start + 0x20;\\n p.geminiFoldComms[i] = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[xStart:xEnd])),\\n x_1: uint256(bytes32(proof[x1Start:x1End])),\\n y_0: uint256(bytes32(proof[yStart:yEnd])),\\n y_1: uint256(bytes32(proof[y1Start:y1End]))\\n });\\n }\\n\\n boundary = boundary + ((CONST_PROOF_SIZE_LOG_N - 1) * 0x80);\\n\\n // Read gemini a evaluations\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\\n uint256 start = boundary + (i * 0x20);\\n uint256 end = start + 0x20;\\n p.geminiAEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end]));\\n }\\n\\n boundary = boundary + (CONST_PROOF_SIZE_LOG_N * 0x20);\\n\\n // Shplonk\\n p.shplonkQ = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[boundary:boundary + 0x20])),\\n x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])),\\n y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])),\\n y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80]))\\n });\\n\\n boundary = boundary + 0x80;\\n\\n // KZG\\n p.kzgQuotient = Honk.G1ProofPoint({\\n x_0: uint256(bytes32(proof[boundary:boundary + 0x20])),\\n x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])),\\n y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])),\\n y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80]))\\n });\\n\\n return p;\\n }\\n}\\n\\n// EC Point utilities\\nfunction convertProofPoint(Honk.G1ProofPoint memory input) pure returns (Honk.G1Point memory) {\\n return Honk.G1Point({x: input.x_0 | (input.x_1 << 136), y: input.y_0 | (input.y_1 << 136)});\\n}\\n\\nfunction ecMul(Honk.G1Point memory point, Fr scalar) view returns (Honk.G1Point memory) {\\n bytes memory input = abi.encodePacked(point.x, point.y, Fr.unwrap(scalar));\\n (bool success, bytes memory result) = address(0x07).staticcall(input);\\n require(success, \\\"ecMul failed\\\");\\n\\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\\n return Honk.G1Point({x: x, y: y});\\n}\\n\\nfunction ecAdd(Honk.G1Point memory point0, Honk.G1Point memory point1) view returns (Honk.G1Point memory) {\\n bytes memory input = abi.encodePacked(point0.x, point0.y, point1.x, point1.y);\\n (bool success, bytes memory result) = address(0x06).staticcall(input);\\n require(success, \\\"ecAdd failed\\\");\\n\\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\\n return Honk.G1Point({x: x, y: y});\\n}\\n\\nfunction ecSub(Honk.G1Point memory point0, Honk.G1Point memory point1) view returns (Honk.G1Point memory) {\\n // We negate the second point\\n uint256 negativePoint1Y = (Q - point1.y) % Q;\\n bytes memory input = abi.encodePacked(point0.x, point0.y, point1.x, negativePoint1Y);\\n (bool success, bytes memory result) = address(0x06).staticcall(input);\\n require(success, \\\"ecAdd failed\\\");\\n\\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\\n return Honk.G1Point({x: x, y: y});\\n}\\n\\nfunction negateInplace(Honk.G1Point memory point) pure returns (Honk.G1Point memory) {\\n point.y = (Q - point.y) % Q;\\n return point;\\n}\\n\\n\\nlibrary RelationsLib {\\n Fr internal constant GRUMPKIN_CURVE_B_PARAMETER_NEGATED = Fr.wrap(17); // -(-17)\\n\\n function accumulateRelationEvaluations(Honk.Proof memory proof, Transcript memory tp, Fr powPartialEval)\\n internal\\n pure\\n returns (Fr accumulator)\\n {\\n Fr[NUMBER_OF_ENTITIES] memory purportedEvaluations = proof.sumcheckEvaluations;\\n Fr[NUMBER_OF_SUBRELATIONS] memory evaluations;\\n\\n // Accumulate all relations in Ultra Honk - each with varying number of subrelations\\n accumulateArithmeticRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulatePermutationRelation(purportedEvaluations, tp, evaluations, powPartialEval);\\n accumulateLogDerivativeLookupRelation(purportedEvaluations, tp, evaluations, powPartialEval);\\n accumulateDeltaRangeRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulateEllipticRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulateAuxillaryRelation(purportedEvaluations, tp, evaluations, powPartialEval);\\n accumulatePoseidonExternalRelation(purportedEvaluations, evaluations, powPartialEval);\\n accumulatePoseidonInternalRelation(purportedEvaluations, evaluations, powPartialEval);\\n // batch the subrelations with the alpha challenges to obtain the full honk relation\\n accumulator = scaleAndBatchSubrelations(evaluations, tp.alphas);\\n }\\n\\n /**\\n * Aesthetic helper function that is used to index by enum into proof.sumcheckEvaluations, it avoids\\n * the relation checking code being cluttered with uint256 type casting, which is often a different colour in code\\n * editors, and thus is noisy.\\n */\\n function wire(Fr[NUMBER_OF_ENTITIES] memory p, WIRE _wire) internal pure returns (Fr) {\\n return p[uint256(_wire)];\\n }\\n\\n uint256 internal constant NEG_HALF_MODULO_P = 0x183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f8000000;\\n /**\\n * Ultra Arithmetic Relation\\n *\\n */\\n function accumulateArithmeticRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n // Relation 0\\n Fr q_arith = wire(p, WIRE.Q_ARITH);\\n {\\n Fr neg_half = Fr.wrap(NEG_HALF_MODULO_P);\\n\\n Fr accum = (q_arith - Fr.wrap(3)) * (wire(p, WIRE.Q_M) * wire(p, WIRE.W_R) * wire(p, WIRE.W_L)) * neg_half;\\n accum = accum + (wire(p, WIRE.Q_L) * wire(p, WIRE.W_L)) + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_R))\\n + (wire(p, WIRE.Q_O) * wire(p, WIRE.W_O)) + (wire(p, WIRE.Q_4) * wire(p, WIRE.W_4)) + wire(p, WIRE.Q_C);\\n accum = accum + (q_arith - Fr.wrap(1)) * wire(p, WIRE.W_4_SHIFT);\\n accum = accum * q_arith;\\n accum = accum * domainSep;\\n evals[0] = accum;\\n }\\n\\n // Relation 1\\n {\\n Fr accum = wire(p, WIRE.W_L) + wire(p, WIRE.W_4) - wire(p, WIRE.W_L_SHIFT) + wire(p, WIRE.Q_M);\\n accum = accum * (q_arith - Fr.wrap(2));\\n accum = accum * (q_arith - Fr.wrap(1));\\n accum = accum * q_arith;\\n accum = accum * domainSep;\\n evals[1] = accum;\\n }\\n }\\n\\n function accumulatePermutationRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Transcript memory tp,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n Fr grand_product_numerator;\\n Fr grand_product_denominator;\\n\\n {\\n Fr num = wire(p, WIRE.W_L) + wire(p, WIRE.ID_1) * tp.beta + tp.gamma;\\n num = num * (wire(p, WIRE.W_R) + wire(p, WIRE.ID_2) * tp.beta + tp.gamma);\\n num = num * (wire(p, WIRE.W_O) + wire(p, WIRE.ID_3) * tp.beta + tp.gamma);\\n num = num * (wire(p, WIRE.W_4) + wire(p, WIRE.ID_4) * tp.beta + tp.gamma);\\n\\n grand_product_numerator = num;\\n }\\n {\\n Fr den = wire(p, WIRE.W_L) + wire(p, WIRE.SIGMA_1) * tp.beta + tp.gamma;\\n den = den * (wire(p, WIRE.W_R) + wire(p, WIRE.SIGMA_2) * tp.beta + tp.gamma);\\n den = den * (wire(p, WIRE.W_O) + wire(p, WIRE.SIGMA_3) * tp.beta + tp.gamma);\\n den = den * (wire(p, WIRE.W_4) + wire(p, WIRE.SIGMA_4) * tp.beta + tp.gamma);\\n\\n grand_product_denominator = den;\\n }\\n\\n // Contribution 2\\n {\\n Fr acc = (wire(p, WIRE.Z_PERM) + wire(p, WIRE.LAGRANGE_FIRST)) * grand_product_numerator;\\n\\n acc = acc\\n - (\\n (wire(p, WIRE.Z_PERM_SHIFT) + (wire(p, WIRE.LAGRANGE_LAST) * tp.publicInputsDelta))\\n * grand_product_denominator\\n );\\n acc = acc * domainSep;\\n evals[2] = acc;\\n }\\n\\n // Contribution 3\\n {\\n Fr acc = (wire(p, WIRE.LAGRANGE_LAST) * wire(p, WIRE.Z_PERM_SHIFT)) * domainSep;\\n evals[3] = acc;\\n }\\n }\\n\\n function accumulateLogDerivativeLookupRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Transcript memory tp,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n Fr write_term;\\n Fr read_term;\\n\\n // Calculate the write term (the table accumulation)\\n {\\n write_term = wire(p, WIRE.TABLE_1) + tp.gamma + (wire(p, WIRE.TABLE_2) * tp.eta)\\n + (wire(p, WIRE.TABLE_3) * tp.etaTwo) + (wire(p, WIRE.TABLE_4) * tp.etaThree);\\n }\\n\\n // Calculate the write term\\n {\\n Fr derived_entry_1 = wire(p, WIRE.W_L) + tp.gamma + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_L_SHIFT));\\n Fr derived_entry_2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_M) * wire(p, WIRE.W_R_SHIFT);\\n Fr derived_entry_3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_C) * wire(p, WIRE.W_O_SHIFT);\\n\\n read_term = derived_entry_1 + (derived_entry_2 * tp.eta) + (derived_entry_3 * tp.etaTwo)\\n + (wire(p, WIRE.Q_O) * tp.etaThree);\\n }\\n\\n Fr read_inverse = wire(p, WIRE.LOOKUP_INVERSES) * write_term;\\n Fr write_inverse = wire(p, WIRE.LOOKUP_INVERSES) * read_term;\\n\\n Fr inverse_exists_xor = wire(p, WIRE.LOOKUP_READ_TAGS) + wire(p, WIRE.Q_LOOKUP)\\n - (wire(p, WIRE.LOOKUP_READ_TAGS) * wire(p, WIRE.Q_LOOKUP));\\n\\n // Inverse calculated correctly relation\\n Fr accumulatorNone = read_term * write_term * wire(p, WIRE.LOOKUP_INVERSES) - inverse_exists_xor;\\n accumulatorNone = accumulatorNone * domainSep;\\n\\n // Inverse\\n Fr accumulatorOne = wire(p, WIRE.Q_LOOKUP) * read_inverse - wire(p, WIRE.LOOKUP_READ_COUNTS) * write_inverse;\\n\\n evals[4] = accumulatorNone;\\n evals[5] = accumulatorOne;\\n }\\n\\n function accumulateDeltaRangeRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n Fr minus_one = Fr.wrap(0) - Fr.wrap(1);\\n Fr minus_two = Fr.wrap(0) - Fr.wrap(2);\\n Fr minus_three = Fr.wrap(0) - Fr.wrap(3);\\n\\n // Compute wire differences\\n Fr delta_1 = wire(p, WIRE.W_R) - wire(p, WIRE.W_L);\\n Fr delta_2 = wire(p, WIRE.W_O) - wire(p, WIRE.W_R);\\n Fr delta_3 = wire(p, WIRE.W_4) - wire(p, WIRE.W_O);\\n Fr delta_4 = wire(p, WIRE.W_L_SHIFT) - wire(p, WIRE.W_4);\\n\\n // Contribution 6\\n {\\n Fr acc = delta_1;\\n acc = acc * (delta_1 + minus_one);\\n acc = acc * (delta_1 + minus_two);\\n acc = acc * (delta_1 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[6] = acc;\\n }\\n\\n // Contribution 7\\n {\\n Fr acc = delta_2;\\n acc = acc * (delta_2 + minus_one);\\n acc = acc * (delta_2 + minus_two);\\n acc = acc * (delta_2 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[7] = acc;\\n }\\n\\n // Contribution 8\\n {\\n Fr acc = delta_3;\\n acc = acc * (delta_3 + minus_one);\\n acc = acc * (delta_3 + minus_two);\\n acc = acc * (delta_3 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[8] = acc;\\n }\\n\\n // Contribution 9\\n {\\n Fr acc = delta_4;\\n acc = acc * (delta_4 + minus_one);\\n acc = acc * (delta_4 + minus_two);\\n acc = acc * (delta_4 + minus_three);\\n acc = acc * wire(p, WIRE.Q_RANGE);\\n acc = acc * domainSep;\\n evals[9] = acc;\\n }\\n }\\n\\n struct EllipticParams {\\n // Points\\n Fr x_1;\\n Fr y_1;\\n Fr x_2;\\n Fr y_2;\\n Fr y_3;\\n Fr x_3;\\n // push accumulators into memory\\n Fr x_double_identity;\\n }\\n\\n function accumulateEllipticRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n EllipticParams memory ep;\\n ep.x_1 = wire(p, WIRE.W_R);\\n ep.y_1 = wire(p, WIRE.W_O);\\n\\n ep.x_2 = wire(p, WIRE.W_L_SHIFT);\\n ep.y_2 = wire(p, WIRE.W_4_SHIFT);\\n ep.y_3 = wire(p, WIRE.W_O_SHIFT);\\n ep.x_3 = wire(p, WIRE.W_R_SHIFT);\\n\\n Fr q_sign = wire(p, WIRE.Q_L);\\n Fr q_is_double = wire(p, WIRE.Q_M);\\n\\n // Contribution 10 point addition, x-coordinate check\\n // q_elliptic * (x3 + x2 + x1)(x2 - x1)(x2 - x1) - y2^2 - y1^2 + 2(y2y1)*q_sign = 0\\n Fr x_diff = (ep.x_2 - ep.x_1);\\n Fr y1_sqr = (ep.y_1 * ep.y_1);\\n {\\n // Move to top\\n Fr partialEval = domainSep;\\n\\n Fr y2_sqr = (ep.y_2 * ep.y_2);\\n Fr y1y2 = ep.y_1 * ep.y_2 * q_sign;\\n Fr x_add_identity = (ep.x_3 + ep.x_2 + ep.x_1);\\n x_add_identity = x_add_identity * x_diff * x_diff;\\n x_add_identity = x_add_identity - y2_sqr - y1_sqr + y1y2 + y1y2;\\n\\n evals[10] = x_add_identity * partialEval * wire(p, WIRE.Q_ELLIPTIC) * (Fr.wrap(1) - q_is_double);\\n }\\n\\n // Contribution 11 point addition, x-coordinate check\\n // q_elliptic * (q_sign * y1 + y3)(x2 - x1) + (x3 - x1)(y2 - q_sign * y1) = 0\\n {\\n Fr y1_plus_y3 = ep.y_1 + ep.y_3;\\n Fr y_diff = ep.y_2 * q_sign - ep.y_1;\\n Fr y_add_identity = y1_plus_y3 * x_diff + (ep.x_3 - ep.x_1) * y_diff;\\n evals[11] = y_add_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * (Fr.wrap(1) - q_is_double);\\n }\\n\\n // Contribution 10 point doubling, x-coordinate check\\n // (x3 + x1 + x1) (4y1*y1) - 9 * x1 * x1 * x1 * x1 = 0\\n // N.B. we're using the equivalence x1*x1*x1 === y1*y1 - curve_b to reduce degree by 1\\n {\\n Fr x_pow_4 = (y1_sqr + GRUMPKIN_CURVE_B_PARAMETER_NEGATED) * ep.x_1;\\n Fr y1_sqr_mul_4 = y1_sqr + y1_sqr;\\n y1_sqr_mul_4 = y1_sqr_mul_4 + y1_sqr_mul_4;\\n Fr x1_pow_4_mul_9 = x_pow_4 * Fr.wrap(9);\\n\\n // NOTE: pushed into memory (stack >:'( )\\n ep.x_double_identity = (ep.x_3 + ep.x_1 + ep.x_1) * y1_sqr_mul_4 - x1_pow_4_mul_9;\\n\\n Fr acc = ep.x_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;\\n evals[10] = evals[10] + acc;\\n }\\n\\n // Contribution 11 point doubling, y-coordinate check\\n // (y1 + y1) (2y1) - (3 * x1 * x1)(x1 - x3) = 0\\n {\\n Fr x1_sqr_mul_3 = (ep.x_1 + ep.x_1 + ep.x_1) * ep.x_1;\\n Fr y_double_identity = x1_sqr_mul_3 * (ep.x_1 - ep.x_3) - (ep.y_1 + ep.y_1) * (ep.y_1 + ep.y_3);\\n evals[11] = evals[11] + y_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;\\n }\\n }\\n\\n // Constants for the auxiliary relation\\n Fr constant LIMB_SIZE = Fr.wrap(uint256(1) << 68);\\n Fr constant SUBLIMB_SHIFT = Fr.wrap(uint256(1) << 14);\\n\\n // Parameters used within the Auxiliary Relation\\n // A struct is used to work around stack too deep. This relation has alot of variables\\n struct AuxParams {\\n Fr limb_subproduct;\\n Fr non_native_field_gate_1;\\n Fr non_native_field_gate_2;\\n Fr non_native_field_gate_3;\\n Fr limb_accumulator_1;\\n Fr limb_accumulator_2;\\n Fr memory_record_check;\\n Fr partial_record_check;\\n Fr next_gate_access_type;\\n Fr record_delta;\\n Fr index_delta;\\n Fr adjacent_values_match_if_adjacent_indices_match;\\n Fr adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation;\\n Fr access_check;\\n Fr next_gate_access_type_is_boolean;\\n Fr ROM_consistency_check_identity;\\n Fr RAM_consistency_check_identity;\\n Fr timestamp_delta;\\n Fr RAM_timestamp_check_identity;\\n Fr memory_identity;\\n Fr index_is_monotonically_increasing;\\n Fr auxiliary_identity;\\n }\\n\\n function accumulateAuxillaryRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Transcript memory tp,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n AuxParams memory ap;\\n\\n /**\\n * Contribution 12\\n * Non native field arithmetic gate 2\\n * deg 4\\n *\\n * _ _\\n * / _ _ _ 14 \\\\\\n * q_2 . q_4 | (w_1 . w_2) + (w_1 . w_2) + (w_1 . w_4 + w_2 . w_3 - w_3) . 2 - w_3 - w_4 |\\n * \\\\_ _/\\n *\\n *\\n */\\n ap.limb_subproduct = wire(p, WIRE.W_L) * wire(p, WIRE.W_R_SHIFT) + wire(p, WIRE.W_L_SHIFT) * wire(p, WIRE.W_R);\\n ap.non_native_field_gate_2 =\\n (wire(p, WIRE.W_L) * wire(p, WIRE.W_4) + wire(p, WIRE.W_R) * wire(p, WIRE.W_O) - wire(p, WIRE.W_O_SHIFT));\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 * LIMB_SIZE;\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 - wire(p, WIRE.W_4_SHIFT);\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 + ap.limb_subproduct;\\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 * wire(p, WIRE.Q_4);\\n\\n ap.limb_subproduct = ap.limb_subproduct * LIMB_SIZE;\\n ap.limb_subproduct = ap.limb_subproduct + (wire(p, WIRE.W_L_SHIFT) * wire(p, WIRE.W_R_SHIFT));\\n ap.non_native_field_gate_1 = ap.limb_subproduct;\\n ap.non_native_field_gate_1 = ap.non_native_field_gate_1 - (wire(p, WIRE.W_O) + wire(p, WIRE.W_4));\\n ap.non_native_field_gate_1 = ap.non_native_field_gate_1 * wire(p, WIRE.Q_O);\\n\\n ap.non_native_field_gate_3 = ap.limb_subproduct;\\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 + wire(p, WIRE.W_4);\\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 - (wire(p, WIRE.W_O_SHIFT) + wire(p, WIRE.W_4_SHIFT));\\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 * wire(p, WIRE.Q_M);\\n\\n Fr non_native_field_identity =\\n ap.non_native_field_gate_1 + ap.non_native_field_gate_2 + ap.non_native_field_gate_3;\\n non_native_field_identity = non_native_field_identity * wire(p, WIRE.Q_R);\\n\\n // ((((w2' * 2^14 + w1') * 2^14 + w3) * 2^14 + w2) * 2^14 + w1 - w4) * qm\\n // deg 2\\n ap.limb_accumulator_1 = wire(p, WIRE.W_R_SHIFT) * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_L_SHIFT);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_O);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_R);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_L);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 - wire(p, WIRE.W_4);\\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * wire(p, WIRE.Q_4);\\n\\n // ((((w3' * 2^14 + w2') * 2^14 + w1') * 2^14 + w4) * 2^14 + w3 - w4') * qm\\n // deg 2\\n ap.limb_accumulator_2 = wire(p, WIRE.W_O_SHIFT) * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_R_SHIFT);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_L_SHIFT);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_4);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_O);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 - wire(p, WIRE.W_4_SHIFT);\\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * wire(p, WIRE.Q_M);\\n\\n Fr limb_accumulator_identity = ap.limb_accumulator_1 + ap.limb_accumulator_2;\\n limb_accumulator_identity = limb_accumulator_identity * wire(p, WIRE.Q_O); // deg 3\\n\\n /**\\n * MEMORY\\n *\\n * A RAM memory record contains a tuple of the following fields:\\n * * i: `index` of memory cell being accessed\\n * * t: `timestamp` of memory cell being accessed (used for RAM, set to 0 for ROM)\\n * * v: `value` of memory cell being accessed\\n * * a: `access` type of record. read: 0 = read, 1 = write\\n * * r: `record` of memory cell. record = access + index * eta + timestamp * eta_two + value * eta_three\\n *\\n * A ROM memory record contains a tuple of the following fields:\\n * * i: `index` of memory cell being accessed\\n * * v: `value1` of memory cell being accessed (ROM tables can store up to 2 values per index)\\n * * v2:`value2` of memory cell being accessed (ROM tables can store up to 2 values per index)\\n * * r: `record` of memory cell. record = index * eta + value2 * eta_two + value1 * eta_three\\n *\\n * When performing a read/write access, the values of i, t, v, v2, a, r are stored in the following wires +\\n * selectors, depending on whether the gate is a RAM read/write or a ROM read\\n *\\n * | gate type | i | v2/t | v | a | r |\\n * | --------- | -- | ----- | -- | -- | -- |\\n * | ROM | w1 | w2 | w3 | -- | w4 |\\n * | RAM | w1 | w2 | w3 | qc | w4 |\\n *\\n * (for accesses where `index` is a circuit constant, it is assumed the circuit will apply a copy constraint on\\n * `w2` to fix its value)\\n *\\n *\\n */\\n\\n /**\\n * Memory Record Check\\n * Partial degree: 1\\n * Total degree: 4\\n *\\n * A ROM/ROM access gate can be evaluated with the identity:\\n *\\n * qc + w1 \\\\eta + w2 \\\\eta_two + w3 \\\\eta_three - w4 = 0\\n *\\n * For ROM gates, qc = 0\\n */\\n ap.memory_record_check = wire(p, WIRE.W_O) * tp.etaThree;\\n ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_R) * tp.etaTwo);\\n ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_L) * tp.eta);\\n ap.memory_record_check = ap.memory_record_check + wire(p, WIRE.Q_C);\\n ap.partial_record_check = ap.memory_record_check; // used in RAM consistency check; deg 1 or 4\\n ap.memory_record_check = ap.memory_record_check - wire(p, WIRE.W_4);\\n\\n /**\\n * Contribution 13 & 14\\n * ROM Consistency Check\\n * Partial degree: 1\\n * Total degree: 4\\n *\\n * For every ROM read, a set equivalence check is applied between the record witnesses, and a second set of\\n * records that are sorted.\\n *\\n * We apply the following checks for the sorted records:\\n *\\n * 1. w1, w2, w3 correctly map to 'index', 'v1, 'v2' for a given record value at w4\\n * 2. index values for adjacent records are monotonically increasing\\n * 3. if, at gate i, index_i == index_{i + 1}, then value1_i == value1_{i + 1} and value2_i == value2_{i + 1}\\n *\\n */\\n ap.index_delta = wire(p, WIRE.W_L_SHIFT) - wire(p, WIRE.W_L);\\n ap.record_delta = wire(p, WIRE.W_4_SHIFT) - wire(p, WIRE.W_4);\\n\\n ap.index_is_monotonically_increasing = ap.index_delta * ap.index_delta - ap.index_delta; // deg 2\\n\\n ap.adjacent_values_match_if_adjacent_indices_match = (ap.index_delta * MINUS_ONE + Fr.wrap(1)) * ap.record_delta; // deg 2\\n\\n evals[13] = ap.adjacent_values_match_if_adjacent_indices_match * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))\\n * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5\\n evals[14] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))\\n * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5\\n\\n ap.ROM_consistency_check_identity = ap.memory_record_check * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R)); // deg 3 or 7\\n\\n /**\\n * Contributions 15,16,17\\n * RAM Consistency Check\\n *\\n * The 'access' type of the record is extracted with the expression `w_4 - ap.partial_record_check`\\n * (i.e. for an honest Prover `w1 * eta + w2 * eta^2 + w3 * eta^3 - w4 = access`.\\n * This is validated by requiring `access` to be boolean\\n *\\n * For two adjacent entries in the sorted list if _both_\\n * A) index values match\\n * B) adjacent access value is 0 (i.e. next gate is a READ)\\n * then\\n * C) both values must match.\\n * The gate boolean check is\\n * (A && B) => C === !(A && B) || C === !A || !B || C\\n *\\n * N.B. it is the responsibility of the circuit writer to ensure that every RAM cell is initialized\\n * with a WRITE operation.\\n */\\n Fr access_type = (wire(p, WIRE.W_4) - ap.partial_record_check); // will be 0 or 1 for honest Prover; deg 1 or 4\\n ap.access_check = access_type * access_type - access_type; // check value is 0 or 1; deg 2 or 8\\n\\n ap.next_gate_access_type = wire(p, WIRE.W_O_SHIFT) * tp.etaThree;\\n ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_R_SHIFT) * tp.etaTwo);\\n ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_L_SHIFT) * tp.eta);\\n ap.next_gate_access_type = wire(p, WIRE.W_4_SHIFT) - ap.next_gate_access_type;\\n\\n Fr value_delta = wire(p, WIRE.W_O_SHIFT) - wire(p, WIRE.W_O);\\n ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation = (\\n ap.index_delta * MINUS_ONE + Fr.wrap(1)\\n ) * value_delta * (ap.next_gate_access_type * MINUS_ONE + Fr.wrap(1)); // deg 3 or 6\\n\\n // We can't apply the RAM consistency check identity on the final entry in the sorted list (the wires in the\\n // next gate would make the identity fail). We need to validate that its 'access type' bool is correct. Can't\\n // do with an arithmetic gate because of the `eta` factors. We need to check that the *next* gate's access\\n // type is correct, to cover this edge case\\n // deg 2 or 4\\n ap.next_gate_access_type_is_boolean =\\n ap.next_gate_access_type * ap.next_gate_access_type - ap.next_gate_access_type;\\n\\n // Putting it all together...\\n evals[15] = ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation\\n * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5 or 8\\n evals[16] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4\\n evals[17] = ap.next_gate_access_type_is_boolean * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4 or 6\\n\\n ap.RAM_consistency_check_identity = ap.access_check * (wire(p, WIRE.Q_ARITH)); // deg 3 or 9\\n\\n /**\\n * RAM Timestamp Consistency Check\\n *\\n * | w1 | w2 | w3 | w4 |\\n * | index | timestamp | timestamp_check | -- |\\n *\\n * Let delta_index = index_{i + 1} - index_{i}\\n *\\n * Iff delta_index == 0, timestamp_check = timestamp_{i + 1} - timestamp_i\\n * Else timestamp_check = 0\\n */\\n ap.timestamp_delta = wire(p, WIRE.W_R_SHIFT) - wire(p, WIRE.W_R);\\n ap.RAM_timestamp_check_identity =\\n (ap.index_delta * MINUS_ONE + Fr.wrap(1)) * ap.timestamp_delta - wire(p, WIRE.W_O); // deg 3\\n\\n /**\\n * Complete Contribution 12\\n * The complete RAM/ROM memory identity\\n * Partial degree:\\n */\\n ap.memory_identity = ap.ROM_consistency_check_identity; // deg 3 or 6\\n ap.memory_identity =\\n ap.memory_identity + ap.RAM_timestamp_check_identity * (wire(p, WIRE.Q_4) * wire(p, WIRE.Q_L)); // deg 4\\n ap.memory_identity = ap.memory_identity + ap.memory_record_check * (wire(p, WIRE.Q_M) * wire(p, WIRE.Q_L)); // deg 3 or 6\\n ap.memory_identity = ap.memory_identity + ap.RAM_consistency_check_identity; // deg 3 or 9\\n\\n // (deg 3 or 9) + (deg 4) + (deg 3)\\n ap.auxiliary_identity = ap.memory_identity + non_native_field_identity + limb_accumulator_identity;\\n ap.auxiliary_identity = ap.auxiliary_identity * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4 or 10\\n evals[12] = ap.auxiliary_identity;\\n }\\n\\n struct PoseidonExternalParams {\\n Fr s1;\\n Fr s2;\\n Fr s3;\\n Fr s4;\\n Fr u1;\\n Fr u2;\\n Fr u3;\\n Fr u4;\\n Fr t0;\\n Fr t1;\\n Fr t2;\\n Fr t3;\\n Fr v1;\\n Fr v2;\\n Fr v3;\\n Fr v4;\\n Fr q_pos_by_scaling;\\n }\\n\\n function accumulatePoseidonExternalRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n PoseidonExternalParams memory ep;\\n\\n ep.s1 = wire(p, WIRE.W_L) + wire(p, WIRE.Q_L);\\n ep.s2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_R);\\n ep.s3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_O);\\n ep.s4 = wire(p, WIRE.W_4) + wire(p, WIRE.Q_4);\\n\\n ep.u1 = ep.s1 * ep.s1 * ep.s1 * ep.s1 * ep.s1;\\n ep.u2 = ep.s2 * ep.s2 * ep.s2 * ep.s2 * ep.s2;\\n ep.u3 = ep.s3 * ep.s3 * ep.s3 * ep.s3 * ep.s3;\\n ep.u4 = ep.s4 * ep.s4 * ep.s4 * ep.s4 * ep.s4;\\n // matrix mul v = M_E * u with 14 additions\\n ep.t0 = ep.u1 + ep.u2; // u_1 + u_2\\n ep.t1 = ep.u3 + ep.u4; // u_3 + u_4\\n ep.t2 = ep.u2 + ep.u2 + ep.t1; // 2u_2\\n // ep.t2 += ep.t1; // 2u_2 + u_3 + u_4\\n ep.t3 = ep.u4 + ep.u4 + ep.t0; // 2u_4\\n // ep.t3 += ep.t0; // u_1 + u_2 + 2u_4\\n ep.v4 = ep.t1 + ep.t1;\\n ep.v4 = ep.v4 + ep.v4 + ep.t3;\\n // ep.v4 += ep.t3; // u_1 + u_2 + 4u_3 + 6u_4\\n ep.v2 = ep.t0 + ep.t0;\\n ep.v2 = ep.v2 + ep.v2 + ep.t2;\\n // ep.v2 += ep.t2; // 4u_1 + 6u_2 + u_3 + u_4\\n ep.v1 = ep.t3 + ep.v2; // 5u_1 + 7u_2 + u_3 + 3u_4\\n ep.v3 = ep.t2 + ep.v4; // u_1 + 3u_2 + 5u_3 + 7u_4\\n\\n ep.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_EXTERNAL) * domainSep;\\n evals[18] = evals[18] + ep.q_pos_by_scaling * (ep.v1 - wire(p, WIRE.W_L_SHIFT));\\n\\n evals[19] = evals[19] + ep.q_pos_by_scaling * (ep.v2 - wire(p, WIRE.W_R_SHIFT));\\n\\n evals[20] = evals[20] + ep.q_pos_by_scaling * (ep.v3 - wire(p, WIRE.W_O_SHIFT));\\n\\n evals[21] = evals[21] + ep.q_pos_by_scaling * (ep.v4 - wire(p, WIRE.W_4_SHIFT));\\n }\\n\\n struct PoseidonInternalParams {\\n Fr u1;\\n Fr u2;\\n Fr u3;\\n Fr u4;\\n Fr u_sum;\\n Fr v1;\\n Fr v2;\\n Fr v3;\\n Fr v4;\\n Fr s1;\\n Fr q_pos_by_scaling;\\n }\\n\\n function accumulatePoseidonInternalRelation(\\n Fr[NUMBER_OF_ENTITIES] memory p,\\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\\n Fr domainSep\\n ) internal pure {\\n PoseidonInternalParams memory ip;\\n\\n Fr[4] memory INTERNAL_MATRIX_DIAGONAL = [\\n FrLib.from(0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e7),\\n FrLib.from(0x0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b),\\n FrLib.from(0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac15),\\n FrLib.from(0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b)\\n ];\\n\\n // add round constants\\n ip.s1 = wire(p, WIRE.W_L) + wire(p, WIRE.Q_L);\\n\\n // apply s-box round\\n ip.u1 = ip.s1 * ip.s1 * ip.s1 * ip.s1 * ip.s1;\\n ip.u2 = wire(p, WIRE.W_R);\\n ip.u3 = wire(p, WIRE.W_O);\\n ip.u4 = wire(p, WIRE.W_4);\\n\\n // matrix mul with v = M_I * u 4 muls and 7 additions\\n ip.u_sum = ip.u1 + ip.u2 + ip.u3 + ip.u4;\\n\\n ip.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_INTERNAL) * domainSep;\\n\\n ip.v1 = ip.u1 * INTERNAL_MATRIX_DIAGONAL[0] + ip.u_sum;\\n evals[22] = evals[22] + ip.q_pos_by_scaling * (ip.v1 - wire(p, WIRE.W_L_SHIFT));\\n\\n ip.v2 = ip.u2 * INTERNAL_MATRIX_DIAGONAL[1] + ip.u_sum;\\n evals[23] = evals[23] + ip.q_pos_by_scaling * (ip.v2 - wire(p, WIRE.W_R_SHIFT));\\n\\n ip.v3 = ip.u3 * INTERNAL_MATRIX_DIAGONAL[2] + ip.u_sum;\\n evals[24] = evals[24] + ip.q_pos_by_scaling * (ip.v3 - wire(p, WIRE.W_O_SHIFT));\\n\\n ip.v4 = ip.u4 * INTERNAL_MATRIX_DIAGONAL[3] + ip.u_sum;\\n evals[25] = evals[25] + ip.q_pos_by_scaling * (ip.v4 - wire(p, WIRE.W_4_SHIFT));\\n }\\n\\n function scaleAndBatchSubrelations(\\n Fr[NUMBER_OF_SUBRELATIONS] memory evaluations,\\n Fr[NUMBER_OF_ALPHAS] memory subrelationChallenges\\n ) internal pure returns (Fr accumulator) {\\n accumulator = accumulator + evaluations[0];\\n\\n for (uint256 i = 1; i < NUMBER_OF_SUBRELATIONS; ++i) {\\n accumulator = accumulator + evaluations[i] * subrelationChallenges[i - 1];\\n }\\n }\\n}\\n\\n// Errors\\nerror PublicInputsLengthWrong();\\nerror SumcheckFailed();\\nerror ShpleminiFailed();\\n\\ninterface IVerifier {\\n function verify(bytes calldata _proof, bytes32[] calldata _publicInputs) external view returns (bool);\\n}\\n\\n// Smart contract verifier of honk proofs\\ncontract HonkVerifier is IVerifier\\n{\\n using FrLib for Fr;\\n\\n function verify(bytes calldata proof, bytes32[] calldata publicInputs) public view override returns (bool) {\\n Honk.VerificationKey memory vk = loadVerificationKey();\\n Honk.Proof memory p = TranscriptLib.loadProof(proof);\\n\\n if (publicInputs.length != vk.publicInputsSize) {\\n revert PublicInputsLengthWrong();\\n }\\n\\n // Generate the fiat shamir challenges for the whole protocol\\n Transcript memory t = TranscriptLib.generateTranscript(p, publicInputs, vk.publicInputsSize);\\n\\n // Compute the public input delta\\n t.publicInputsDelta =\\n computePublicInputDelta(publicInputs, t.beta, t.gamma, vk.circuitSize, p.publicInputsOffset);\\n\\n // Sumcheck\\n bool sumcheckVerified = verifySumcheck(p, t);\\n if (!sumcheckVerified) revert SumcheckFailed();\\n\\n bool shpleminiVerified = verifyShplemini(p, vk, t);\\n if (!shpleminiVerified) revert ShpleminiFailed();\\n\\n return sumcheckVerified && shpleminiVerified; // Boolean condition not required - nice for vanity :)\\n }\\n\\n function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) {\\n return HonkVerificationKey.loadVerificationKey();\\n }\\n\\n function computePublicInputDelta(\\n bytes32[] memory publicInputs,\\n Fr beta,\\n Fr gamma,\\n uint256 domainSize,\\n uint256 offset\\n ) internal view returns (Fr publicInputDelta) {\\n Fr numerator = Fr.wrap(1);\\n Fr denominator = Fr.wrap(1);\\n\\n Fr numeratorAcc = gamma + (beta * FrLib.from(domainSize + offset));\\n Fr denominatorAcc = gamma - (beta * FrLib.from(offset + 1));\\n\\n {\\n for (uint256 i = 0; i < NUMBER_OF_PUBLIC_INPUTS; i++) {\\n Fr pubInput = FrLib.fromBytes32(publicInputs[i]);\\n\\n numerator = numerator * (numeratorAcc + pubInput);\\n denominator = denominator * (denominatorAcc + pubInput);\\n\\n numeratorAcc = numeratorAcc + beta;\\n denominatorAcc = denominatorAcc - beta;\\n }\\n }\\n\\n // Fr delta = numerator / denominator; // TOOO: batch invert later?\\n publicInputDelta = FrLib.div(numerator, denominator);\\n }\\n\\n uint256 constant ROUND_TARGET = 0;\\n\\n function verifySumcheck(Honk.Proof memory proof, Transcript memory tp) internal view returns (bool verified) {\\n Fr roundTarget;\\n Fr powPartialEvaluation = Fr.wrap(1);\\n\\n // We perform sumcheck reductions over log n rounds ( the multivariate degree )\\n for (uint256 round; round < LOG_N; ++round) {\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariate = proof.sumcheckUnivariates[round];\\n bool valid = checkSum(roundUnivariate, roundTarget);\\n if (!valid) revert SumcheckFailed();\\n\\n Fr roundChallenge = tp.sumCheckUChallenges[round];\\n\\n // Update the round target for the next rounf\\n roundTarget = computeNextTargetSum(roundUnivariate, roundChallenge);\\n powPartialEvaluation = partiallyEvaluatePOW(tp, powPartialEvaluation, roundChallenge, round);\\n }\\n\\n // Last round\\n Fr grandHonkRelationSum = RelationsLib.accumulateRelationEvaluations(proof, tp, powPartialEvaluation);\\n verified = (grandHonkRelationSum == roundTarget);\\n }\\n\\n function checkSum(Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariate, Fr roundTarget)\\n internal\\n pure\\n returns (bool checked)\\n {\\n Fr totalSum = roundUnivariate[0] + roundUnivariate[1];\\n checked = totalSum == roundTarget;\\n }\\n\\n // Return the new target sum for the next sumcheck round\\n function computeNextTargetSum(Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariates, Fr roundChallenge)\\n internal\\n view\\n returns (Fr targetSum)\\n {\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory BARYCENTRIC_LAGRANGE_DENOMINATORS = [\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffec51),\\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000002d0),\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff11),\\n Fr.wrap(0x0000000000000000000000000000000000000000000000000000000000000090),\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff71),\\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000000f0),\\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593effffd31),\\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000013b0)\\n ];\\n\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory BARYCENTRIC_DOMAIN = [\\n Fr.wrap(0x00),\\n Fr.wrap(0x01),\\n Fr.wrap(0x02),\\n Fr.wrap(0x03),\\n Fr.wrap(0x04),\\n Fr.wrap(0x05),\\n Fr.wrap(0x06),\\n Fr.wrap(0x07)\\n ];\\n // To compute the next target sum, we evaluate the given univariate at a point u (challenge).\\n\\n // Performing Barycentric evaluations\\n // Compute B(x)\\n Fr numeratorValue = Fr.wrap(1);\\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\\n numeratorValue = numeratorValue * (roundChallenge - Fr.wrap(i));\\n }\\n\\n // Calculate domain size N of inverses\\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory denominatorInverses;\\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\\n Fr inv = BARYCENTRIC_LAGRANGE_DENOMINATORS[i];\\n inv = inv * (roundChallenge - BARYCENTRIC_DOMAIN[i]);\\n inv = FrLib.invert(inv);\\n denominatorInverses[i] = inv;\\n }\\n\\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\\n Fr term = roundUnivariates[i];\\n term = term * denominatorInverses[i];\\n targetSum = targetSum + term;\\n }\\n\\n // Scale the sum by the value of B(x)\\n targetSum = targetSum * numeratorValue;\\n }\\n\\n // Univariate evaluation of the monomial ((1-X_l) + X_l.B_l) at the challenge point X_l=u_l\\n function partiallyEvaluatePOW(Transcript memory tp, Fr currentEvaluation, Fr roundChallenge, uint256 round)\\n internal\\n pure\\n returns (Fr newEvaluation)\\n {\\n Fr univariateEval = Fr.wrap(1) + (roundChallenge * (tp.gateChallenges[round] - Fr.wrap(1)));\\n newEvaluation = currentEvaluation * univariateEval;\\n }\\n\\n // Avoid stack too deep\\n struct ShpleminiIntermediates {\\n // i-th unshifted commitment is multiplied by \\u2212\\u03c1\\u2071 and the unshifted_scalar ( 1/(z\\u2212r) + \\u03bd/(z+r) )\\n Fr unshiftedScalar;\\n // i-th shifted commitment is multiplied by \\u2212\\u03c1\\u2071\\u207a\\u1d4f and the shifted_scalar r\\u207b\\u00b9 \\u22c5 (1/(z\\u2212r) \\u2212 \\u03bd/(z+r))\\n Fr shiftedScalar;\\n // Scalar to be multiplied by [1]\\u2081\\n Fr constantTermAccumulator;\\n // Accumulator for powers of rho\\n Fr batchingChallenge;\\n // Linear combination of multilinear (sumcheck) evaluations and powers of rho\\n Fr batchedEvaluation;\\n }\\n\\n function verifyShplemini(Honk.Proof memory proof, Honk.VerificationKey memory vk, Transcript memory tp)\\n internal\\n view\\n returns (bool verified)\\n {\\n ShpleminiIntermediates memory mem; // stack\\n\\n // - Compute vector (r, r\\u00b2, ... , r\\u00b2\\u207d\\u207f\\u207b\\u00b9\\u207e), where n = log_circuit_size, I think this should be CONST_PROOF_SIZE\\n Fr[CONST_PROOF_SIZE_LOG_N] memory powers_of_evaluation_challenge = computeSquares(tp.geminiR);\\n\\n // Arrays hold values that will be linearly combined for the gemini and shplonk batch openings\\n Fr[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory scalars;\\n Honk.G1Point[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory commitments;\\n\\n Fr[CONST_PROOF_SIZE_LOG_N + 1] memory inverse_vanishing_evals =\\n computeInvertedGeminiDenominators(tp, powers_of_evaluation_challenge);\\n\\n mem.unshiftedScalar = inverse_vanishing_evals[0] + (tp.shplonkNu * inverse_vanishing_evals[1]);\\n mem.shiftedScalar =\\n tp.geminiR.invert() * (inverse_vanishing_evals[0] - (tp.shplonkNu * inverse_vanishing_evals[1]));\\n\\n scalars[0] = Fr.wrap(1);\\n commitments[0] = convertProofPoint(proof.shplonkQ);\\n\\n /* Batch multivariate opening claims, shifted and unshifted\\n * The vector of scalars is populated as follows:\\n * \\\\f[\\n * \\\\left(\\n * - \\\\left(\\\\frac{1}{z-r} + \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right),\\n * \\\\ldots,\\n * - \\\\rho^{i+k-1} \\\\times \\\\left(\\\\frac{1}{z-r} + \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right),\\n * - \\\\rho^{i+k} \\\\times \\\\frac{1}{r} \\\\times \\\\left(\\\\frac{1}{z-r} - \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right),\\n * \\\\ldots,\\n * - \\\\rho^{k+m-1} \\\\times \\\\frac{1}{r} \\\\times \\\\left(\\\\frac{1}{z-r} - \\\\nu \\\\times \\\\frac{1}{z+r}\\\\right)\\n * \\\\right)\\n * \\\\f]\\n *\\n * The following vector is concatenated to the vector of commitments:\\n * \\\\f[\\n * f_0, \\\\ldots, f_{m-1}, f_{\\\\text{shift}, 0}, \\\\ldots, f_{\\\\text{shift}, k-1}\\n * \\\\f]\\n *\\n * Simultaneously, the evaluation of the multilinear polynomial\\n * \\\\f[\\n * \\\\sum \\\\rho^i \\\\cdot f_i + \\\\sum \\\\rho^{i+k} \\\\cdot f_{\\\\text{shift}, i}\\n * \\\\f]\\n * at the challenge point \\\\f$ (u_0,\\\\ldots, u_{n-1}) \\\\f$ is computed.\\n *\\n * This approach minimizes the number of iterations over the commitments to multilinear polynomials\\n * and eliminates the need to store the powers of \\\\f$ \\\\rho \\\\f$.\\n */\\n mem.batchingChallenge = Fr.wrap(1);\\n mem.batchedEvaluation = Fr.wrap(0);\\n\\n for (uint256 i = 1; i <= NUMBER_UNSHIFTED; ++i) {\\n scalars[i] = mem.unshiftedScalar.neg() * mem.batchingChallenge;\\n mem.batchedEvaluation = mem.batchedEvaluation + (proof.sumcheckEvaluations[i - 1] * mem.batchingChallenge);\\n mem.batchingChallenge = mem.batchingChallenge * tp.rho;\\n }\\n // g commitments are accumulated at r\\n for (uint256 i = NUMBER_UNSHIFTED + 1; i <= NUMBER_OF_ENTITIES; ++i) {\\n scalars[i] = mem.shiftedScalar.neg() * mem.batchingChallenge;\\n mem.batchedEvaluation = mem.batchedEvaluation + (proof.sumcheckEvaluations[i - 1] * mem.batchingChallenge);\\n mem.batchingChallenge = mem.batchingChallenge * tp.rho;\\n }\\n\\n commitments[1] = vk.qm;\\n commitments[2] = vk.qc;\\n commitments[3] = vk.ql;\\n commitments[4] = vk.qr;\\n commitments[5] = vk.qo;\\n commitments[6] = vk.q4;\\n commitments[7] = vk.qArith;\\n commitments[8] = vk.qDeltaRange;\\n commitments[9] = vk.qElliptic;\\n commitments[10] = vk.qAux;\\n commitments[11] = vk.qLookup;\\n commitments[12] = vk.qPoseidon2External;\\n commitments[13] = vk.qPoseidon2Internal;\\n commitments[14] = vk.s1;\\n commitments[15] = vk.s2;\\n commitments[16] = vk.s3;\\n commitments[17] = vk.s4;\\n commitments[18] = vk.id1;\\n commitments[19] = vk.id2;\\n commitments[20] = vk.id3;\\n commitments[21] = vk.id4;\\n commitments[22] = vk.t1;\\n commitments[23] = vk.t2;\\n commitments[24] = vk.t3;\\n commitments[25] = vk.t4;\\n commitments[26] = vk.lagrangeFirst;\\n commitments[27] = vk.lagrangeLast;\\n\\n // Accumulate proof points\\n commitments[28] = convertProofPoint(proof.w1);\\n commitments[29] = convertProofPoint(proof.w2);\\n commitments[30] = convertProofPoint(proof.w3);\\n commitments[31] = convertProofPoint(proof.w4);\\n commitments[32] = convertProofPoint(proof.zPerm);\\n commitments[33] = convertProofPoint(proof.lookupInverses);\\n commitments[34] = convertProofPoint(proof.lookupReadCounts);\\n commitments[35] = convertProofPoint(proof.lookupReadTags);\\n\\n // to be Shifted\\n commitments[36] = vk.t1;\\n commitments[37] = vk.t2;\\n commitments[38] = vk.t3;\\n commitments[39] = vk.t4;\\n commitments[40] = convertProofPoint(proof.w1);\\n commitments[41] = convertProofPoint(proof.w2);\\n commitments[42] = convertProofPoint(proof.w3);\\n commitments[43] = convertProofPoint(proof.w4);\\n commitments[44] = convertProofPoint(proof.zPerm);\\n\\n /* Batch gemini claims from the prover\\n * place the commitments to gemini a\\u1d62 to the vector of commitments, compute the contributions from\\n * a\\u1d62(\\u2212r\\u00b2\\u2071) for i=1, \\u2026 , n\\u22121 to the constant term accumulator, add corresponding scalars\\n *\\n * 1. Moves the vector\\n * \\\\f[\\n * \\\\left( \\\\text{com}(A_1), \\\\text{com}(A_2), \\\\ldots, \\\\text{com}(A_{n-1}) \\\\right)\\n * \\\\f]\\n * to the 'commitments' vector.\\n *\\n * 2. Computes the scalars:\\n * \\\\f[\\n * \\\\frac{\\\\nu^{2}}{z + r^2}, \\\\frac{\\\\nu^3}{z + r^4}, \\\\ldots, \\\\frac{\\\\nu^{n-1}}{z + r^{2^{n-1}}}\\n * \\\\f]\\n * and places them into the 'scalars' vector.\\n *\\n * 3. Accumulates the summands of the constant term:\\n * \\\\f[\\n * \\\\sum_{i=2}^{n-1} \\\\frac{\\\\nu^{i} \\\\cdot A_i(-r^{2^i})}{z + r^{2^i}}\\n * \\\\f]\\n * and adds them to the 'constant_term_accumulator'.\\n */\\n mem.constantTermAccumulator = Fr.wrap(0);\\n mem.batchingChallenge = tp.shplonkNu.sqr();\\n\\n for (uint256 i; i < CONST_PROOF_SIZE_LOG_N - 1; ++i) {\\n bool dummy_round = i >= (LOG_N - 1);\\n\\n Fr scalingFactor = Fr.wrap(0);\\n if (!dummy_round) {\\n scalingFactor = mem.batchingChallenge * inverse_vanishing_evals[i + 2];\\n scalars[NUMBER_OF_ENTITIES + 1 + i] = scalingFactor.neg();\\n }\\n\\n mem.constantTermAccumulator =\\n mem.constantTermAccumulator + (scalingFactor * proof.geminiAEvaluations[i + 1]);\\n mem.batchingChallenge = mem.batchingChallenge * tp.shplonkNu;\\n\\n commitments[NUMBER_OF_ENTITIES + 1 + i] = convertProofPoint(proof.geminiFoldComms[i]);\\n }\\n\\n // Add contributions from A\\u2080(r) and A\\u2080(-r) to constant_term_accumulator:\\n // Compute evaluation A\\u2080(r)\\n Fr a_0_pos = computeGeminiBatchedUnivariateEvaluation(\\n tp, mem.batchedEvaluation, proof.geminiAEvaluations, powers_of_evaluation_challenge\\n );\\n\\n mem.constantTermAccumulator = mem.constantTermAccumulator + (a_0_pos * inverse_vanishing_evals[0]);\\n mem.constantTermAccumulator =\\n mem.constantTermAccumulator + (proof.geminiAEvaluations[0] * tp.shplonkNu * inverse_vanishing_evals[1]);\\n\\n // Finalise the batch opening claim\\n commitments[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N] = Honk.G1Point({x: 1, y: 2});\\n scalars[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N] = mem.constantTermAccumulator;\\n\\n Honk.G1Point memory quotient_commitment = convertProofPoint(proof.kzgQuotient);\\n\\n commitments[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 1] = quotient_commitment;\\n scalars[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 1] = tp.shplonkZ; // evaluation challenge\\n\\n Honk.G1Point memory P_0 = batchMul(commitments, scalars);\\n Honk.G1Point memory P_1 = negateInplace(quotient_commitment);\\n\\n return pairing(P_0, P_1);\\n }\\n\\n function computeSquares(Fr r) internal pure returns (Fr[CONST_PROOF_SIZE_LOG_N] memory squares) {\\n squares[0] = r;\\n for (uint256 i = 1; i < CONST_PROOF_SIZE_LOG_N; ++i) {\\n squares[i] = squares[i - 1].sqr();\\n }\\n }\\n\\n function computeInvertedGeminiDenominators(\\n Transcript memory tp,\\n Fr[CONST_PROOF_SIZE_LOG_N] memory eval_challenge_powers\\n ) internal view returns (Fr[CONST_PROOF_SIZE_LOG_N + 1] memory inverse_vanishing_evals) {\\n Fr eval_challenge = tp.shplonkZ;\\n inverse_vanishing_evals[0] = (eval_challenge - eval_challenge_powers[0]).invert();\\n\\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; ++i) {\\n Fr round_inverted_denominator = Fr.wrap(0);\\n if (i <= LOG_N + 1) {\\n round_inverted_denominator = (eval_challenge + eval_challenge_powers[i]).invert();\\n }\\n inverse_vanishing_evals[i + 1] = round_inverted_denominator;\\n }\\n }\\n\\n function computeGeminiBatchedUnivariateEvaluation(\\n Transcript memory tp,\\n Fr batchedEvalAccumulator,\\n Fr[CONST_PROOF_SIZE_LOG_N] memory geminiEvaluations,\\n Fr[CONST_PROOF_SIZE_LOG_N] memory geminiEvalChallengePowers\\n ) internal view returns (Fr a_0_pos) {\\n for (uint256 i = CONST_PROOF_SIZE_LOG_N; i > 0; --i) {\\n Fr challengePower = geminiEvalChallengePowers[i - 1];\\n Fr u = tp.sumCheckUChallenges[i - 1];\\n Fr evalNeg = geminiEvaluations[i - 1];\\n\\n Fr batchedEvalRoundAcc = (\\n (challengePower * batchedEvalAccumulator * Fr.wrap(2))\\n - evalNeg * (challengePower * (Fr.wrap(1) - u) - u)\\n );\\n // Divide by the denominator\\n batchedEvalRoundAcc = batchedEvalRoundAcc * (challengePower * (Fr.wrap(1) - u) + u).invert();\\n\\n bool is_dummy_round = (i > LOG_N);\\n if (!is_dummy_round) {\\n batchedEvalAccumulator = batchedEvalRoundAcc;\\n }\\n }\\n\\n a_0_pos = batchedEvalAccumulator;\\n }\\n\\n // This implementation is the same as above with different constants\\n function batchMul(\\n Honk.G1Point[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory base,\\n Fr[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory scalars\\n ) internal view returns (Honk.G1Point memory result) {\\n uint256 limit = NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2;\\n assembly {\\n let success := 0x01\\n let free := mload(0x40)\\n\\n // Write the original into the accumulator\\n // Load into memory for ecMUL, leave offset for eccAdd result\\n // base is an array of pointers, so we have to dereference them\\n mstore(add(free, 0x40), mload(mload(base)))\\n mstore(add(free, 0x60), mload(add(0x20, mload(base))))\\n // Add scalar\\n mstore(add(free, 0x80), mload(scalars))\\n success := and(success, staticcall(gas(), 7, add(free, 0x40), 0x60, free, 0x40))\\n\\n let count := 0x01\\n for {} lt(count, limit) { count := add(count, 1) } {\\n // Get loop offsets\\n let base_base := add(base, mul(count, 0x20))\\n let scalar_base := add(scalars, mul(count, 0x20))\\n\\n mstore(add(free, 0x40), mload(mload(base_base)))\\n mstore(add(free, 0x60), mload(add(0x20, mload(base_base))))\\n // Add scalar\\n mstore(add(free, 0x80), mload(scalar_base))\\n\\n success := and(success, staticcall(gas(), 7, add(free, 0x40), 0x60, add(free, 0x40), 0x40))\\n // accumulator = accumulator + accumulator_2\\n success := and(success, staticcall(gas(), 6, free, 0x80, free, 0x40))\\n }\\n\\n // Return the result - i hate this\\n mstore(result, mload(free))\\n mstore(add(result, 0x20), mload(add(free, 0x20)))\\n }\\n }\\n\\n function pairing(Honk.G1Point memory rhs, Honk.G1Point memory lhs) internal view returns (bool) {\\n bytes memory input = abi.encodePacked(\\n rhs.x,\\n rhs.y,\\n // Fixed G1 point\\n uint256(0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2),\\n uint256(0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed),\\n uint256(0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b),\\n uint256(0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa),\\n lhs.x,\\n lhs.y,\\n // G1 point from VK\\n uint256(0x260e01b251f6f1c7e7ff4e580791dee8ea51d87a358e038b4efe30fac09383c1),\\n uint256(0x0118c4d5b837bcc2bc89b5b398b5974e9f5944073b32078b7e231fec938883b0),\\n uint256(0x04fc6369f7110fe3d25156c1bb9a72859cf2a04641f99ba4ee413c80da6a5fe4),\\n uint256(0x22febda3c0c0632a56475b4214e5615e11e6dd3f96e6cea2854a87d4dacc5e55)\\n );\\n\\n (bool success, bytes memory result) = address(0x08).staticcall(input);\\n bool decodedResult = abi.decode(result, (bool));\\n return success && decodedResult;\\n }\\n}\\n\\n// Conversion util - Duplicated as we cannot template LOG_N\\nfunction convertPoints(Honk.G1ProofPoint[LOG_N + 1] memory commitments)\\n pure\\n returns (Honk.G1Point[LOG_N + 1] memory converted)\\n{\\n for (uint256 i; i < LOG_N + 1; ++i) {\\n converted[i] = convertProofPoint(commitments[i]);\\n }\\n}\\n\\n\",\"keccak256\":\"0x53b6264c492aa965c64cb7ba841634dfd41ab54239d00d2db76b683e62525125\",\"license\":\"Apache-2.0\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b506040516134dd3803806134dd83398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b612af6806109e783390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b6080516109086100df60003960008181604b0152818160c401526101d501526109086000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780638186328814610096578063fa45edfb146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a4366004610348565b6100bc565b61006d6100b7366004610348565b6101a6565b60008060001b7f0000000000000000000000000000000000000000000000000000000000000000836040516024016100f49190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052516101749061033b565b61017f929190610418565b8190604051809103906000f590508015801561019f573d6000803e3d6000fd5b5092915050565b60006102e16000801b604051806020016101bf9061033b565b6020820181038252601f19601f820116604052507f0000000000000000000000000000000000000000000000000000000000000000856040516024016102059190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052905161028a93929101610418565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526102c69291602001610486565b604051602081830303815290604052805190602001206102e7565b92915050565b60006102f48383306102fb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff81536055902073ffffffffffffffffffffffffffffffffffffffff16949350505050565b61041d806104b683390190565b6000608082840312801561035b57600080fd5b509092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461038557600080fd5b50565b81358152602080830135908201526080810160408301356103a881610363565b73ffffffffffffffffffffffffffffffffffffffff16604083015260608301356103d181610363565b73ffffffffffffffffffffffffffffffffffffffff811660608401525092915050565b60005b8381101561040f5781810151838201526020016103f7565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104538160608501602087016103f4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104988184602088016103f4565b8351908301906104ac8183602088016103f4565b0194935050505056fe608060405260405161041d38038061041d83398101604081905261002291610268565b61002c8282610033565b5050610358565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b919061033c565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b038111156102ae57600080fd5b8301601f810185136102bf57600080fd5b80516001600160401b038111156102d8576102d861022e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103065761030661022e565b60405281815282820160200187101561031e57600080fd5b61032f826020830160208601610244565b8093505050509250929050565b6000825161034e818460208701610244565b9190910192915050565b60b7806103666000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220f1b09f534c51785fb64f6d562751f2bfff62c23101c6e5ebe906ffba3b0c3e3164736f6c634300081b0033a26469706673582212201f8d7d348f8b56e137c408e046670fd22c23febe5363bd975d12a87410e9ba7e64736f6c634300081b003360c06040523060805234801561001457600080fd5b50604051612af6380380612af683398101604081905261003391610100565b6001600160a01b03811660a05261004861004e565b50610130565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561009e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100fd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60006020828403121561011257600080fd5b81516001600160a01b038116811461012957600080fd5b9392505050565b60805160a05161296961018d60003960008181610425015281816107f3015281816108a101528181610df201528181610eb001528181610ef701526110ce0152600081816112cd015281816112f6015261151201526129696000f3fe6080604052600436106101635760003560e01c8063ad3cb1cc116100c0578063b6f360fb11610074578063c399ec8811610059578063c399ec8814610527578063d087d2881461053c578063f23a6e611461055157600080fd5b8063b6f360fb146104bf578063bc197c81146104df57600080fd5b8063b2e684be116100a5578063b2e684be1461046a578063b387ef921461048a578063b61d27f61461049f57600080fd5b8063ad3cb1cc146103c0578063b0d691fe1461041657600080fd5b80634bd834c7116101175780634f1ef286116100fc5780634f1ef2861461032057806352d1902d146103335780637a28f8bc1461034857600080fd5b80634bd834c7146102725780634d44560d1461030057600080fd5b806319822f7c1161014857806319822f7c1461021a57806334fcd5be146102485780634a58db191461026a57600080fd5b806301ffc9a71461016f578063150b7a02146101a457600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b5061018f61018a366004611ef4565b610597565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101e96101bf366004611fa1565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161019b565b34801561022657600080fd5b5061023a610235366004612014565b61067c565b60405190815260200161019b565b34801561025457600080fd5b506102686102633660046120ad565b610708565b005b6102686107f1565b34801561027e57600080fd5b506000546102c79073ffffffffffffffffffffffffffffffffffffffff8116907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff90911660208301520161019b565b34801561030c57600080fd5b5061026861031b3660046120ef565b610897565b61026861032e3660046121f7565b61094e565b34801561033f57600080fd5b5061023a61096d565b34801561035457600080fd5b5060015460025460035460045461038493929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff9182169284019290925216606082015260800161019b565b3480156103cc57600080fd5b506104096040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161019b91906122b5565b34801561042257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561047657600080fd5b506102686104853660046122e0565b61099c565b34801561049657600080fd5b50610445610b6c565b3480156104ab57600080fd5b506102686104ba366004612315565b610bd8565b3480156104cb57600080fd5b506102686104da366004612371565b610c27565b3480156104eb57600080fd5b506101e96104fa36600461238d565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561053357600080fd5b5061023a610dac565b34801561054857600080fd5b5061023a610e63565b34801561055d57600080fd5b506101e961056c366004612458565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60007fb2e684be000000000000000000000000000000000000000000000000000000006106ac60608601866124d4565b6106b591612539565b7fffffffff0000000000000000000000000000000000000000000000000000000016036106e457506000610701565b6106ec610edf565b6106f68484610f80565b90506107018261104b565b9392505050565b6107106110b6565b60005b818110156107ec576107e48383838181106107305761073061259f565b905060200281019061074291906125ce565b61075090602081019061260c565b8484848181106107625761076261259f565b905060200281019061077491906125ce565b6020013585858581811061078a5761078a61259f565b905060200281019061079c91906125ce565b6107aa9060408101906124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b600101610713565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b5050505050565b61089f61120f565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050505050565b6109566112b5565b61095f826113b9565b61096982826113c1565b5050565b60006109776114fa565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b426109ad610e106020840135612658565b1015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20657870697265642070726f6f660000000000000060448201526064015b60405180910390fd5b604080516080810182526001548152600254602082015260035473ffffffffffffffffffffffffffffffffffffffff908116928201929092526004549091166060820152600090610a7390610a6e8461266b565b611569565b905080610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f66000000000000006044820152606401610a11565b6040518060400160405280836040013560001c73ffffffffffffffffffffffffffffffffffffffff1681526020016201518042610b1991906126ee565b6bffffffffffffffffffffffff908116909152815160209092015116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116176000555050565b604080518082019091526000805473ffffffffffffffffffffffffffffffffffffffff811683527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208301819052909190421115610bd257600091505090565b51919050565b610be06110b6565b610c21848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610c725750825b905060008267ffffffffffffffff166001148015610c8f5750303b155b905081158015610c9d575080155b15610cd4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610d355784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b856001610d428282612712565b505083156109465784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e91906127c6565b905090565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610e1d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610a11565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610ffb81610fc16101008701876124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061185592505050565b73ffffffffffffffffffffffffffffffffffffffff16611019610b6c565b73ffffffffffffffffffffffffffffffffffffffff161461103e576001915050610676565b5060009392505050565b50565b80156110485760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610890565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061112c57506110fd610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152606401610a11565b6000808473ffffffffffffffffffffffffffffffffffffffff1684846040516111bb91906127df565b60006040518083038185875af1925050503d80600081146111f8576040519150601f19603f3d011682016040523d82523d6000602084013e6111fd565b606091505b50915091508161089057805160208201fd5b611217610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061124f57503330145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152606401610a11565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061138257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166113697f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61104861120f565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611446575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611443918101906127c6565b60015b611494576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146114f0576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6107ec838361187f565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016115bb929190918252602082015260400190565b602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc91906127f1565b611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610a11565b600061167183604001516118e2565b80519091506003906000906116869083612658565b67ffffffffffffffff81111561169e5761169e61211b565b6040519080825280602002602001820160405280156116c7578160200160208202803683370190505b50865190915060009082826116db81612813565b9350815181106116ed576116ed61259f565b602002602001018181525050856020015160001b82828061170d90612813565b93508151811061171f5761171f61259f565b60209081029190910101526060860151828261173a81612813565b93508151811061174c5761174c61259f565b60200260200101818152505060005b84518110156117ae578481815181106117765761177661259f565b016020015160f81c838361178981612813565b94508151811061179b5761179b61259f565b602090810291909101015260010161175b565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e49161180991869060040161284b565b602060405180830381865afa158015611826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184a91906127f1565b979650505050505050565b60008060008061186586866118ef565b925092509250611875828261193c565b5090949350505050565b61188882611a40565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118da576107ec8282611b0f565b610969611b92565b6060610676826020611bca565b600080600083516041036119295760208401516040850151606086015160001a61191b88828585611d29565b955095509550505050611935565b50508151600091506002905b9250925092565b6000826003811115611950576119506128a5565b03611959575050565b600182600381111561196d5761196d6128a5565b036119a4576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156119b8576119b86128a5565b036119f2576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6003826003811115611a0657611a066128a5565b03610969576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611aa9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051611b3991906127df565b600060405180830381855af49150503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5091509150611b89858383611e23565b95945050505050565b3415610f7e576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826000611bda8460026128d4565b67ffffffffffffffff811115611bf257611bf261211b565b6040519080825280601f01601f191660200182016040528015611c1c576020820181803683370190505b5090506000611c2c8560026128d4565b611c37906001612658565b90505b6001811115611cde577f303132333435363738396162636465660000000000000000000000000000000083600f1660108110611c7857611c7861259f565b1a60f81b82611c886002846128eb565b81518110611c9857611c9861259f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c91611cd7816128fe565b9050611c3a565b508115611d21576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610a11565b949350505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611d645750600091506003905082611e19565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611db8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611e0f57506000925060019150829050611e19565b9250600091508190505b9450945094915050565b606082611e3857611e3382611eb2565b610701565b8151158015611e5c575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611eab576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610a11565b5080610701565b805115611ec25780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215611f0657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461104857600080fd5b60008083601f840112611f6a57600080fd5b50813567ffffffffffffffff811115611f8257600080fd5b602083019150836020828501011115611f9a57600080fd5b9250929050565b600080600080600060808688031215611fb957600080fd5b8535611fc481611f36565b94506020860135611fd481611f36565b935060408601359250606086013567ffffffffffffffff811115611ff757600080fd5b61200388828901611f58565b969995985093965092949392505050565b60008060006060848603121561202957600080fd5b833567ffffffffffffffff81111561204057600080fd5b8401610120818703121561205357600080fd5b95602085013595506040909401359392505050565b60008083601f84011261207a57600080fd5b50813567ffffffffffffffff81111561209257600080fd5b6020830191508360208260051b8501011115611f9a57600080fd5b600080602083850312156120c057600080fd5b823567ffffffffffffffff8111156120d757600080fd5b6120e385828601612068565b90969095509350505050565b6000806040838503121561210257600080fd5b823561210d81611f36565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261215b57600080fd5b813567ffffffffffffffff8111156121755761217561211b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156121c2576121c261211b565b6040528181528382016020018510156121da57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561220a57600080fd5b823561221581611f36565b9150602083013567ffffffffffffffff81111561223157600080fd5b61223d8582860161214a565b9150509250929050565b60005b8381101561226257818101518382015260200161224a565b50506000910152565b60008151808452612283816020860160208601612247565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610701602083018461226b565b6000608082840312156122da57600080fd5b50919050565b6000602082840312156122f257600080fd5b813567ffffffffffffffff81111561230957600080fd5b611d21848285016122c8565b6000806000806060858703121561232b57600080fd5b843561233681611f36565b935060208501359250604085013567ffffffffffffffff81111561235957600080fd5b61236587828801611f58565b95989497509550505050565b60006080828403121561238357600080fd5b61070183836122c8565b60008060008060008060008060a0898b0312156123a957600080fd5b88356123b481611f36565b975060208901356123c481611f36565b9650604089013567ffffffffffffffff8111156123e057600080fd5b6123ec8b828c01612068565b909750955050606089013567ffffffffffffffff81111561240c57600080fd5b6124188b828c01612068565b909550935050608089013567ffffffffffffffff81111561243857600080fd5b6124448b828c01611f58565b999c989b5096995094979396929594505050565b60008060008060008060a0878903121561247157600080fd5b863561247c81611f36565b9550602087013561248c81611f36565b94506040870135935060608701359250608087013567ffffffffffffffff8111156124b657600080fd5b6124c289828a01611f58565b979a9699509497509295939492505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261250957600080fd5b83018035915067ffffffffffffffff82111561252457600080fd5b602001915036819003821315611f9a57600080fd5b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015612598577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261260257600080fd5b9190910192915050565b60006020828403121561261e57600080fd5b813561070181611f36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561067657610676612629565b60006080823603121561267d57600080fd5b6040516080810167ffffffffffffffff811182821017156126a0576126a061211b565b604052823567ffffffffffffffff8111156126ba57600080fd5b6126c63682860161214a565b8252506020838101359082015260408084013590820152606092830135928101929092525090565b6bffffffffffffffffffffffff818116838216019081111561067657610676612629565b8135815560208201356001820155604082013561272e81611f36565b6002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905550606082013561277f81611f36565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055505050565b6000602082840312156127d857600080fd5b5051919050565b60008251612602818460208701612247565b60006020828403121561280357600080fd5b8151801515811461070157600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361284457612844612629565b5060010190565b60408152600061285e604083018561226b565b828103602084015280845180835260208301915060208601925060005b8181101561289957835183526020938401939092019160010161287b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b808202811582820484141761067657610676612629565b8181038181111561067657610676612629565b60008161290d5761290d612629565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212201713b23e80ac60dbf62058f5b0d11b6f5912c9a45cf6e3d29182f94852be320e64736f6c634300081b0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780638186328814610096578063fa45edfb146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a4366004610348565b6100bc565b61006d6100b7366004610348565b6101a6565b60008060001b7f0000000000000000000000000000000000000000000000000000000000000000836040516024016100f49190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052516101749061033b565b61017f929190610418565b8190604051809103906000f590508015801561019f573d6000803e3d6000fd5b5092915050565b60006102e16000801b604051806020016101bf9061033b565b6020820181038252601f19601f820116604052507f0000000000000000000000000000000000000000000000000000000000000000856040516024016102059190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052905161028a93929101610418565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526102c69291602001610486565b604051602081830303815290604052805190602001206102e7565b92915050565b60006102f48383306102fb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff81536055902073ffffffffffffffffffffffffffffffffffffffff16949350505050565b61041d806104b683390190565b6000608082840312801561035b57600080fd5b509092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461038557600080fd5b50565b81358152602080830135908201526080810160408301356103a881610363565b73ffffffffffffffffffffffffffffffffffffffff16604083015260608301356103d181610363565b73ffffffffffffffffffffffffffffffffffffffff811660608401525092915050565b60005b8381101561040f5781810151838201526020016103f7565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104538160608501602087016103f4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104988184602088016103f4565b8351908301906104ac8183602088016103f4565b0194935050505056fe608060405260405161041d38038061041d83398101604081905261002291610268565b61002c8282610033565b5050610358565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b919061033c565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b038111156102ae57600080fd5b8301601f810185136102bf57600080fd5b80516001600160401b038111156102d8576102d861022e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103065761030661022e565b60405281815282820160200187101561031e57600080fd5b61032f826020830160208601610244565b8093505050509250929050565b6000825161034e818460208701610244565b9190910192915050565b60b7806103666000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220f1b09f534c51785fb64f6d562751f2bfff62c23101c6e5ebe906ffba3b0c3e3164736f6c634300081b0033a26469706673582212201f8d7d348f8b56e137c408e046670fd22c23febe5363bd975d12a87410e9ba7e64736f6c634300081b0033", "devdoc": { "kind": "dev", "methods": {}, diff --git a/packages/contracts/deployments/baseSepolia/solcInputs/8d3d7e5538e592539a63aff937e00165.json b/packages/contracts/deployments/baseSepolia/solcInputs/8d3d7e5538e592539a63aff937e00165.json new file mode 100644 index 0000000..29935e6 --- /dev/null +++ b/packages/contracts/deployments/baseSepolia/solcInputs/8d3d7e5538e592539a63aff937e00165.json @@ -0,0 +1,156 @@ +{ + "language": "Solidity", + "sources": { + "@account-abstraction/contracts/core/BaseAccount.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.23;\n\n/* solhint-disable avoid-low-level-calls */\n/* solhint-disable no-empty-blocks */\n\nimport \"../interfaces/IAccount.sol\";\nimport \"../interfaces/IEntryPoint.sol\";\nimport \"./UserOperationLib.sol\";\n\n/**\n * Basic account implementation.\n * This contract provides the basic logic for implementing the IAccount interface - validateUserOp\n * Specific account implementation should inherit it and provide the account-specific logic.\n */\nabstract contract BaseAccount is IAccount {\n using UserOperationLib for PackedUserOperation;\n\n /**\n * Return the account nonce.\n * This method returns the next sequential nonce.\n * For a nonce of a specific key, use `entrypoint.getNonce(account, key)`\n */\n function getNonce() public view virtual returns (uint256) {\n return entryPoint().getNonce(address(this), 0);\n }\n\n /**\n * Return the entryPoint used by this account.\n * Subclass should return the current entryPoint used by this account.\n */\n function entryPoint() public view virtual returns (IEntryPoint);\n\n /// @inheritdoc IAccount\n function validateUserOp(\n PackedUserOperation calldata userOp,\n bytes32 userOpHash,\n uint256 missingAccountFunds\n ) external virtual override returns (uint256 validationData) {\n _requireFromEntryPoint();\n validationData = _validateSignature(userOp, userOpHash);\n _validateNonce(userOp.nonce);\n _payPrefund(missingAccountFunds);\n }\n\n /**\n * Ensure the request comes from the known entrypoint.\n */\n function _requireFromEntryPoint() internal view virtual {\n require(\n msg.sender == address(entryPoint()),\n \"account: not from EntryPoint\"\n );\n }\n\n /**\n * Validate the signature is valid for this message.\n * @param userOp - Validate the userOp.signature field.\n * @param userOpHash - Convenient field: the hash of the request, to check the signature against.\n * (also hashes the entrypoint and chain id)\n * @return validationData - Signature and time-range of this operation.\n * <20-byte> aggregatorOrSigFail - 0 for valid signature, 1 to mark signature failure,\n * otherwise, an address of an aggregator contract.\n * <6-byte> validUntil - last timestamp this operation is valid. 0 for \"indefinite\"\n * <6-byte> validAfter - first timestamp this operation is valid\n * If the account doesn't use time-range, it is enough to return\n * SIG_VALIDATION_FAILED value (1) for signature failure.\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\n */\n function _validateSignature(\n PackedUserOperation calldata userOp,\n bytes32 userOpHash\n ) internal virtual returns (uint256 validationData);\n\n /**\n * Validate the nonce of the UserOperation.\n * This method may validate the nonce requirement of this account.\n * e.g.\n * To limit the nonce to use sequenced UserOps only (no \"out of order\" UserOps):\n * `require(nonce < type(uint64).max)`\n * For a hypothetical account that *requires* the nonce to be out-of-order:\n * `require(nonce & type(uint64).max == 0)`\n *\n * The actual nonce uniqueness is managed by the EntryPoint, and thus no other\n * action is needed by the account itself.\n *\n * @param nonce to validate\n *\n * solhint-disable-next-line no-empty-blocks\n */\n function _validateNonce(uint256 nonce) internal view virtual {\n }\n\n /**\n * Sends to the entrypoint (msg.sender) the missing funds for this transaction.\n * SubClass MAY override this method for better funds management\n * (e.g. send to the entryPoint more than the minimum required, so that in future transactions\n * it will not be required to send again).\n * @param missingAccountFunds - The minimum value this method should send the entrypoint.\n * This value MAY be zero, in case there is enough deposit,\n * or the userOp has a paymaster.\n */\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success, ) = payable(msg.sender).call{\n value: missingAccountFunds,\n gas: type(uint256).max\n }(\"\");\n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }\n}\n" + }, + "@account-abstraction/contracts/core/Helpers.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.23;\n\n/* solhint-disable no-inline-assembly */\n\n\n /*\n * For simulation purposes, validateUserOp (and validatePaymasterUserOp)\n * must return this value in case of signature failure, instead of revert.\n */\nuint256 constant SIG_VALIDATION_FAILED = 1;\n\n\n/*\n * For simulation purposes, validateUserOp (and validatePaymasterUserOp)\n * return this value on success.\n */\nuint256 constant SIG_VALIDATION_SUCCESS = 0;\n\n\n/**\n * Returned data from validateUserOp.\n * validateUserOp returns a uint256, which is created by `_packedValidationData` and\n * parsed by `_parseValidationData`.\n * @param aggregator - address(0) - The account validated the signature by itself.\n * address(1) - The account failed to validate the signature.\n * otherwise - This is an address of a signature aggregator that must\n * be used to validate the signature.\n * @param validAfter - This UserOp is valid only after this timestamp.\n * @param validaUntil - This UserOp is valid only up to this timestamp.\n */\nstruct ValidationData {\n address aggregator;\n uint48 validAfter;\n uint48 validUntil;\n}\n\n/**\n * Extract sigFailed, validAfter, validUntil.\n * Also convert zero validUntil to type(uint48).max.\n * @param validationData - The packed validation data.\n */\nfunction _parseValidationData(\n uint256 validationData\n) pure returns (ValidationData memory data) {\n address aggregator = address(uint160(validationData));\n uint48 validUntil = uint48(validationData >> 160);\n if (validUntil == 0) {\n validUntil = type(uint48).max;\n }\n uint48 validAfter = uint48(validationData >> (48 + 160));\n return ValidationData(aggregator, validAfter, validUntil);\n}\n\n/**\n * Helper to pack the return value for validateUserOp.\n * @param data - The ValidationData to pack.\n */\nfunction _packValidationData(\n ValidationData memory data\n) pure returns (uint256) {\n return\n uint160(data.aggregator) |\n (uint256(data.validUntil) << 160) |\n (uint256(data.validAfter) << (160 + 48));\n}\n\n/**\n * Helper to pack the return value for validateUserOp, when not using an aggregator.\n * @param sigFailed - True for signature failure, false for success.\n * @param validUntil - Last timestamp this UserOperation is valid (or zero for infinite).\n * @param validAfter - First timestamp this UserOperation is valid.\n */\nfunction _packValidationData(\n bool sigFailed,\n uint48 validUntil,\n uint48 validAfter\n) pure returns (uint256) {\n return\n (sigFailed ? 1 : 0) |\n (uint256(validUntil) << 160) |\n (uint256(validAfter) << (160 + 48));\n}\n\n/**\n * keccak function over calldata.\n * @dev copy calldata into memory, do keccak and drop allocated memory. Strangely, this is more efficient than letting solidity do it.\n */\n function calldataKeccak(bytes calldata data) pure returns (bytes32 ret) {\n assembly (\"memory-safe\") {\n let mem := mload(0x40)\n let len := data.length\n calldatacopy(mem, data.offset, len)\n ret := keccak256(mem, len)\n }\n }\n\n\n/**\n * The minimum of two numbers.\n * @param a - First number.\n * @param b - Second number.\n */\n function min(uint256 a, uint256 b) pure returns (uint256) {\n return a < b ? a : b;\n }\n" + }, + "@account-abstraction/contracts/core/UserOperationLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.23;\n\n/* solhint-disable no-inline-assembly */\n\nimport \"../interfaces/PackedUserOperation.sol\";\nimport {calldataKeccak, min} from \"./Helpers.sol\";\n\n/**\n * Utility functions helpful when working with UserOperation structs.\n */\nlibrary UserOperationLib {\n\n uint256 public constant PAYMASTER_VALIDATION_GAS_OFFSET = 20;\n uint256 public constant PAYMASTER_POSTOP_GAS_OFFSET = 36;\n uint256 public constant PAYMASTER_DATA_OFFSET = 52;\n /**\n * Get sender from user operation data.\n * @param userOp - The user operation data.\n */\n function getSender(\n PackedUserOperation calldata userOp\n ) internal pure returns (address) {\n address data;\n //read sender from userOp, which is first userOp member (saves 800 gas...)\n assembly {\n data := calldataload(userOp)\n }\n return address(uint160(data));\n }\n\n /**\n * Relayer/block builder might submit the TX with higher priorityFee,\n * but the user should not pay above what he signed for.\n * @param userOp - The user operation data.\n */\n function gasPrice(\n PackedUserOperation calldata userOp\n ) internal view returns (uint256) {\n unchecked {\n (uint256 maxPriorityFeePerGas, uint256 maxFeePerGas) = unpackUints(userOp.gasFees);\n if (maxFeePerGas == maxPriorityFeePerGas) {\n //legacy mode (for networks that don't support basefee opcode)\n return maxFeePerGas;\n }\n return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\n }\n }\n\n /**\n * Pack the user operation data into bytes for hashing.\n * @param userOp - The user operation data.\n */\n function encode(\n PackedUserOperation calldata userOp\n ) internal pure returns (bytes memory ret) {\n address sender = getSender(userOp);\n uint256 nonce = userOp.nonce;\n bytes32 hashInitCode = calldataKeccak(userOp.initCode);\n bytes32 hashCallData = calldataKeccak(userOp.callData);\n bytes32 accountGasLimits = userOp.accountGasLimits;\n uint256 preVerificationGas = userOp.preVerificationGas;\n bytes32 gasFees = userOp.gasFees;\n bytes32 hashPaymasterAndData = calldataKeccak(userOp.paymasterAndData);\n\n return abi.encode(\n sender, nonce,\n hashInitCode, hashCallData,\n accountGasLimits, preVerificationGas, gasFees,\n hashPaymasterAndData\n );\n }\n\n function unpackUints(\n bytes32 packed\n ) internal pure returns (uint256 high128, uint256 low128) {\n return (uint128(bytes16(packed)), uint128(uint256(packed)));\n }\n\n //unpack just the high 128-bits from a packed value\n function unpackHigh128(bytes32 packed) internal pure returns (uint256) {\n return uint256(packed) >> 128;\n }\n\n // unpack just the low 128-bits from a packed value\n function unpackLow128(bytes32 packed) internal pure returns (uint256) {\n return uint128(uint256(packed));\n }\n\n function unpackMaxPriorityFeePerGas(PackedUserOperation calldata userOp)\n internal pure returns (uint256) {\n return unpackHigh128(userOp.gasFees);\n }\n\n function unpackMaxFeePerGas(PackedUserOperation calldata userOp)\n internal pure returns (uint256) {\n return unpackLow128(userOp.gasFees);\n }\n\n function unpackVerificationGasLimit(PackedUserOperation calldata userOp)\n internal pure returns (uint256) {\n return unpackHigh128(userOp.accountGasLimits);\n }\n\n function unpackCallGasLimit(PackedUserOperation calldata userOp)\n internal pure returns (uint256) {\n return unpackLow128(userOp.accountGasLimits);\n }\n\n function unpackPaymasterVerificationGasLimit(PackedUserOperation calldata userOp)\n internal pure returns (uint256) {\n return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET]));\n }\n\n function unpackPostOpGasLimit(PackedUserOperation calldata userOp)\n internal pure returns (uint256) {\n return uint128(bytes16(userOp.paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]));\n }\n\n function unpackPaymasterStaticFields(\n bytes calldata paymasterAndData\n ) internal pure returns (address paymaster, uint256 validationGasLimit, uint256 postOpGasLimit) {\n return (\n address(bytes20(paymasterAndData[: PAYMASTER_VALIDATION_GAS_OFFSET])),\n uint128(bytes16(paymasterAndData[PAYMASTER_VALIDATION_GAS_OFFSET : PAYMASTER_POSTOP_GAS_OFFSET])),\n uint128(bytes16(paymasterAndData[PAYMASTER_POSTOP_GAS_OFFSET : PAYMASTER_DATA_OFFSET]))\n );\n }\n\n /**\n * Hash the user operation data.\n * @param userOp - The user operation data.\n */\n function hash(\n PackedUserOperation calldata userOp\n ) internal pure returns (bytes32) {\n return keccak256(encode(userOp));\n }\n}\n" + }, + "@account-abstraction/contracts/interfaces/IAccount.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\nimport \"./PackedUserOperation.sol\";\n\ninterface IAccount {\n /**\n * Validate user's signature and nonce\n * the entryPoint will make the call to the recipient only if this validation call returns successfully.\n * signature failure should be reported by returning SIG_VALIDATION_FAILED (1).\n * This allows making a \"simulation call\" without a valid signature\n * Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure.\n *\n * @dev Must validate caller is the entryPoint.\n * Must validate the signature and nonce\n * @param userOp - The operation that is about to be executed.\n * @param userOpHash - Hash of the user's request data. can be used as the basis for signature.\n * @param missingAccountFunds - Missing funds on the account's deposit in the entrypoint.\n * This is the minimum amount to transfer to the sender(entryPoint) to be\n * able to make the call. The excess is left as a deposit in the entrypoint\n * for future calls. Can be withdrawn anytime using \"entryPoint.withdrawTo()\".\n * In case there is a paymaster in the request (or the current deposit is high\n * enough), this value will be zero.\n * @return validationData - Packaged ValidationData structure. use `_packValidationData` and\n * `_unpackValidationData` to encode and decode.\n * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure,\n * otherwise, an address of an \"authorizer\" contract.\n * <6-byte> validUntil - Last timestamp this operation is valid. 0 for \"indefinite\"\n * <6-byte> validAfter - First timestamp this operation is valid\n * If an account doesn't use time-range, it is enough to\n * return SIG_VALIDATION_FAILED value (1) for signature failure.\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\n */\n function validateUserOp(\n PackedUserOperation calldata userOp,\n bytes32 userOpHash,\n uint256 missingAccountFunds\n ) external returns (uint256 validationData);\n}\n" + }, + "@account-abstraction/contracts/interfaces/IAggregator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\nimport \"./PackedUserOperation.sol\";\n\n/**\n * Aggregated Signatures validator.\n */\ninterface IAggregator {\n /**\n * Validate aggregated signature.\n * Revert if the aggregated signature does not match the given list of operations.\n * @param userOps - Array of UserOperations to validate the signature for.\n * @param signature - The aggregated signature.\n */\n function validateSignatures(\n PackedUserOperation[] calldata userOps,\n bytes calldata signature\n ) external view;\n\n /**\n * Validate signature of a single userOp.\n * This method should be called by bundler after EntryPointSimulation.simulateValidation() returns\n * the aggregator this account uses.\n * First it validates the signature over the userOp. Then it returns data to be used when creating the handleOps.\n * @param userOp - The userOperation received from the user.\n * @return sigForUserOp - The value to put into the signature field of the userOp when calling handleOps.\n * (usually empty, unless account and aggregator support some kind of \"multisig\".\n */\n function validateUserOpSignature(\n PackedUserOperation calldata userOp\n ) external view returns (bytes memory sigForUserOp);\n\n /**\n * Aggregate multiple signatures into a single value.\n * This method is called off-chain to calculate the signature to pass with handleOps()\n * bundler MAY use optimized custom code perform this aggregation.\n * @param userOps - Array of UserOperations to collect the signatures from.\n * @return aggregatedSignature - The aggregated signature.\n */\n function aggregateSignatures(\n PackedUserOperation[] calldata userOps\n ) external view returns (bytes memory aggregatedSignature);\n}\n" + }, + "@account-abstraction/contracts/interfaces/IEntryPoint.sol": { + "content": "/**\n ** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.\n ** Only one instance required on each chain.\n **/\n// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\n/* solhint-disable avoid-low-level-calls */\n/* solhint-disable no-inline-assembly */\n/* solhint-disable reason-string */\n\nimport \"./PackedUserOperation.sol\";\nimport \"./IStakeManager.sol\";\nimport \"./IAggregator.sol\";\nimport \"./INonceManager.sol\";\n\ninterface IEntryPoint is IStakeManager, INonceManager {\n /***\n * An event emitted after each successful request.\n * @param userOpHash - Unique identifier for the request (hash its entire content, except signature).\n * @param sender - The account that generates this request.\n * @param paymaster - If non-null, the paymaster that pays for this request.\n * @param nonce - The nonce value from the request.\n * @param success - True if the sender transaction succeeded, false if reverted.\n * @param actualGasCost - Actual amount paid (by account or paymaster) for this UserOperation.\n * @param actualGasUsed - Total gas used by this UserOperation (including preVerification, creation,\n * validation and execution).\n */\n event UserOperationEvent(\n bytes32 indexed userOpHash,\n address indexed sender,\n address indexed paymaster,\n uint256 nonce,\n bool success,\n uint256 actualGasCost,\n uint256 actualGasUsed\n );\n\n /**\n * Account \"sender\" was deployed.\n * @param userOpHash - The userOp that deployed this account. UserOperationEvent will follow.\n * @param sender - The account that is deployed\n * @param factory - The factory used to deploy this account (in the initCode)\n * @param paymaster - The paymaster used by this UserOp\n */\n event AccountDeployed(\n bytes32 indexed userOpHash,\n address indexed sender,\n address factory,\n address paymaster\n );\n\n /**\n * An event emitted if the UserOperation \"callData\" reverted with non-zero length.\n * @param userOpHash - The request unique identifier.\n * @param sender - The sender of this request.\n * @param nonce - The nonce used in the request.\n * @param revertReason - The return bytes from the (reverted) call to \"callData\".\n */\n event UserOperationRevertReason(\n bytes32 indexed userOpHash,\n address indexed sender,\n uint256 nonce,\n bytes revertReason\n );\n\n /**\n * An event emitted if the UserOperation Paymaster's \"postOp\" call reverted with non-zero length.\n * @param userOpHash - The request unique identifier.\n * @param sender - The sender of this request.\n * @param nonce - The nonce used in the request.\n * @param revertReason - The return bytes from the (reverted) call to \"callData\".\n */\n event PostOpRevertReason(\n bytes32 indexed userOpHash,\n address indexed sender,\n uint256 nonce,\n bytes revertReason\n );\n\n /**\n * UserOp consumed more than prefund. The UserOperation is reverted, and no refund is made.\n * @param userOpHash - The request unique identifier.\n * @param sender - The sender of this request.\n * @param nonce - The nonce used in the request.\n */\n event UserOperationPrefundTooLow(\n bytes32 indexed userOpHash,\n address indexed sender,\n uint256 nonce\n );\n\n /**\n * An event emitted by handleOps(), before starting the execution loop.\n * Any event emitted before this event, is part of the validation.\n */\n event BeforeExecution();\n\n /**\n * Signature aggregator used by the following UserOperationEvents within this bundle.\n * @param aggregator - The aggregator used for the following UserOperationEvents.\n */\n event SignatureAggregatorChanged(address indexed aggregator);\n\n /**\n * A custom revert error of handleOps, to identify the offending op.\n * Should be caught in off-chain handleOps simulation and not happen on-chain.\n * Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts.\n * NOTE: If simulateValidation passes successfully, there should be no reason for handleOps to fail on it.\n * @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).\n * @param reason - Revert reason. The string starts with a unique code \"AAmn\",\n * where \"m\" is \"1\" for factory, \"2\" for account and \"3\" for paymaster issues,\n * so a failure can be attributed to the correct entity.\n */\n error FailedOp(uint256 opIndex, string reason);\n\n /**\n * A custom revert error of handleOps, to report a revert by account or paymaster.\n * @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).\n * @param reason - Revert reason. see FailedOp(uint256,string), above\n * @param inner - data from inner cought revert reason\n * @dev note that inner is truncated to 2048 bytes\n */\n error FailedOpWithRevert(uint256 opIndex, string reason, bytes inner);\n\n error PostOpReverted(bytes returnData);\n\n /**\n * Error case when a signature aggregator fails to verify the aggregated signature it had created.\n * @param aggregator The aggregator that failed to verify the signature\n */\n error SignatureValidationFailed(address aggregator);\n\n // Return value of getSenderAddress.\n error SenderAddressResult(address sender);\n\n // UserOps handled, per aggregator.\n struct UserOpsPerAggregator {\n PackedUserOperation[] userOps;\n // Aggregator address\n IAggregator aggregator;\n // Aggregated signature\n bytes signature;\n }\n\n /**\n * Execute a batch of UserOperations.\n * No signature aggregator is used.\n * If any account requires an aggregator (that is, it returned an aggregator when\n * performing simulateValidation), then handleAggregatedOps() must be used instead.\n * @param ops - The operations to execute.\n * @param beneficiary - The address to receive the fees.\n */\n function handleOps(\n PackedUserOperation[] calldata ops,\n address payable beneficiary\n ) external;\n\n /**\n * Execute a batch of UserOperation with Aggregators\n * @param opsPerAggregator - The operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts).\n * @param beneficiary - The address to receive the fees.\n */\n function handleAggregatedOps(\n UserOpsPerAggregator[] calldata opsPerAggregator,\n address payable beneficiary\n ) external;\n\n /**\n * Generate a request Id - unique identifier for this request.\n * The request ID is a hash over the content of the userOp (except the signature), the entrypoint and the chainid.\n * @param userOp - The user operation to generate the request ID for.\n * @return hash the hash of this UserOperation\n */\n function getUserOpHash(\n PackedUserOperation calldata userOp\n ) external view returns (bytes32);\n\n /**\n * Gas and return values during simulation.\n * @param preOpGas - The gas used for validation (including preValidationGas)\n * @param prefund - The required prefund for this operation\n * @param accountValidationData - returned validationData from account.\n * @param paymasterValidationData - return validationData from paymaster.\n * @param paymasterContext - Returned by validatePaymasterUserOp (to be passed into postOp)\n */\n struct ReturnInfo {\n uint256 preOpGas;\n uint256 prefund;\n uint256 accountValidationData;\n uint256 paymasterValidationData;\n bytes paymasterContext;\n }\n\n /**\n * Returned aggregated signature info:\n * The aggregator returned by the account, and its current stake.\n */\n struct AggregatorStakeInfo {\n address aggregator;\n StakeInfo stakeInfo;\n }\n\n /**\n * Get counterfactual sender address.\n * Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation.\n * This method always revert, and returns the address in SenderAddressResult error\n * @param initCode - The constructor code to be passed into the UserOperation.\n */\n function getSenderAddress(bytes memory initCode) external;\n\n error DelegateAndRevert(bool success, bytes ret);\n\n /**\n * Helper method for dry-run testing.\n * @dev calling this method, the EntryPoint will make a delegatecall to the given data, and report (via revert) the result.\n * The method always revert, so is only useful off-chain for dry run calls, in cases where state-override to replace\n * actual EntryPoint code is less convenient.\n * @param target a target contract to make a delegatecall from entrypoint\n * @param data data to pass to target in a delegatecall\n */\n function delegateAndRevert(address target, bytes calldata data) external;\n}\n" + }, + "@account-abstraction/contracts/interfaces/INonceManager.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\ninterface INonceManager {\n\n /**\n * Return the next nonce for this sender.\n * Within a given key, the nonce values are sequenced (starting with zero, and incremented by one on each userop)\n * But UserOp with different keys can come with arbitrary order.\n *\n * @param sender the account address\n * @param key the high 192 bit of the nonce\n * @return nonce a full nonce to pass for next UserOp with this sender.\n */\n function getNonce(address sender, uint192 key)\n external view returns (uint256 nonce);\n\n /**\n * Manually increment the nonce of the sender.\n * This method is exposed just for completeness..\n * Account does NOT need to call it, neither during validation, nor elsewhere,\n * as the EntryPoint will update the nonce regardless.\n * Possible use-case is call it with various keys to \"initialize\" their nonces to one, so that future\n * UserOperations will not pay extra for the first transaction with a given key.\n */\n function incrementNonce(uint192 key) external;\n}\n" + }, + "@account-abstraction/contracts/interfaces/IStakeManager.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.7.5;\n\n/**\n * Manage deposits and stakes.\n * Deposit is just a balance used to pay for UserOperations (either by a paymaster or an account).\n * Stake is value locked for at least \"unstakeDelay\" by the staked entity.\n */\ninterface IStakeManager {\n event Deposited(address indexed account, uint256 totalDeposit);\n\n event Withdrawn(\n address indexed account,\n address withdrawAddress,\n uint256 amount\n );\n\n // Emitted when stake or unstake delay are modified.\n event StakeLocked(\n address indexed account,\n uint256 totalStaked,\n uint256 unstakeDelaySec\n );\n\n // Emitted once a stake is scheduled for withdrawal.\n event StakeUnlocked(address indexed account, uint256 withdrawTime);\n\n event StakeWithdrawn(\n address indexed account,\n address withdrawAddress,\n uint256 amount\n );\n\n /**\n * @param deposit - The entity's deposit.\n * @param staked - True if this entity is staked.\n * @param stake - Actual amount of ether staked for this entity.\n * @param unstakeDelaySec - Minimum delay to withdraw the stake.\n * @param withdrawTime - First block timestamp where 'withdrawStake' will be callable, or zero if already locked.\n * @dev Sizes were chosen so that deposit fits into one cell (used during handleOp)\n * and the rest fit into a 2nd cell (used during stake/unstake)\n * - 112 bit allows for 10^15 eth\n * - 48 bit for full timestamp\n * - 32 bit allows 150 years for unstake delay\n */\n struct DepositInfo {\n uint256 deposit;\n bool staked;\n uint112 stake;\n uint32 unstakeDelaySec;\n uint48 withdrawTime;\n }\n\n // API struct used by getStakeInfo and simulateValidation.\n struct StakeInfo {\n uint256 stake;\n uint256 unstakeDelaySec;\n }\n\n /**\n * Get deposit info.\n * @param account - The account to query.\n * @return info - Full deposit information of given account.\n */\n function getDepositInfo(\n address account\n ) external view returns (DepositInfo memory info);\n\n /**\n * Get account balance.\n * @param account - The account to query.\n * @return - The deposit (for gas payment) of the account.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * Add to the deposit of the given account.\n * @param account - The account to add to.\n */\n function depositTo(address account) external payable;\n\n /**\n * Add to the account's stake - amount and delay\n * any pending unstake is first cancelled.\n * @param _unstakeDelaySec - The new lock duration before the deposit can be withdrawn.\n */\n function addStake(uint32 _unstakeDelaySec) external payable;\n\n /**\n * Attempt to unlock the stake.\n * The value can be withdrawn (using withdrawStake) after the unstake delay.\n */\n function unlockStake() external;\n\n /**\n * Withdraw from the (unlocked) stake.\n * Must first call unlockStake and wait for the unstakeDelay to pass.\n * @param withdrawAddress - The address to send withdrawn value.\n */\n function withdrawStake(address payable withdrawAddress) external;\n\n /**\n * Withdraw from the deposit.\n * @param withdrawAddress - The address to send withdrawn value.\n * @param withdrawAmount - The amount to withdraw.\n */\n function withdrawTo(\n address payable withdrawAddress,\n uint256 withdrawAmount\n ) external;\n}\n" + }, + "@account-abstraction/contracts/interfaces/PackedUserOperation.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\n/**\n * User Operation struct\n * @param sender - The sender account of this request.\n * @param nonce - Unique value the sender uses to verify it is not a replay.\n * @param initCode - If set, the account contract will be created by this constructor/\n * @param callData - The method call to execute on this account.\n * @param accountGasLimits - Packed gas limits for validateUserOp and gas limit passed to the callData method call.\n * @param preVerificationGas - Gas not calculated by the handleOps method, but added to the gas paid.\n * Covers batch overhead.\n * @param gasFees - packed gas fields maxPriorityFeePerGas and maxFeePerGas - Same as EIP-1559 gas parameters.\n * @param paymasterAndData - If set, this field holds the paymaster address, verification gas limit, postOp gas limit and paymaster-specific extra data\n * The paymaster will pay for the transaction instead of the sender.\n * @param signature - Sender-verified signature over the entire request, the EntryPoint address and the chain ID.\n */\nstruct PackedUserOperation {\n address sender;\n uint256 nonce;\n bytes initCode;\n bytes callData;\n bytes32 accountGasLimits;\n uint256 preVerificationGas;\n bytes32 gasFees;\n bytes paymasterAndData;\n bytes signature;\n}\n" + }, + "@account-abstraction/contracts/samples/callback/TokenCallbackHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.23;\n\n/* solhint-disable no-empty-blocks */\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\n\n/**\n * Token callback handler.\n * Handles supported tokens' callbacks, allowing account receiving these tokens.\n */\nabstract contract TokenCallbackHandler is IERC721Receiver, IERC1155Receiver {\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return IERC721Receiver.onERC721Received.selector;\n }\n\n function onERC1155Received(\n address,\n address,\n uint256,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return IERC1155Receiver.onERC1155Received.selector;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external pure override returns (bytes4) {\n return IERC1155Receiver.onERC1155BatchReceived.selector;\n }\n\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(IERC721Receiver).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1967.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {UpgradeableBeacon} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.20;\n\nimport {Proxy} from \"../Proxy.sol\";\nimport {ERC1967Utils} from \"./ERC1967Utils.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an\n * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\n *\n * Requirements:\n *\n * - If `data` is empty, `msg.value` must be zero.\n */\n constructor(address implementation, bytes memory _data) payable {\n ERC1967Utils.upgradeToAndCall(implementation, _data);\n }\n\n /**\n * @dev Returns the current implementation address.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _implementation() internal view virtual override returns (address) {\n return ERC1967Utils.getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.21;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev The `implementation` of the proxy is invalid.\n */\n error ERC1967InvalidImplementation(address implementation);\n\n /**\n * @dev The `admin` of the proxy is invalid.\n */\n error ERC1967InvalidAdmin(address admin);\n\n /**\n * @dev The `beacon` of the proxy is invalid.\n */\n error ERC1967InvalidBeacon(address beacon);\n\n /**\n * @dev An upgrade function sees `msg.value > 0` that may be lost.\n */\n error ERC1967NonPayable();\n\n /**\n * @dev Returns the current implementation address.\n */\n function getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the ERC-1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n if (newImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(newImplementation);\n }\n StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n * to avoid stuck value in the contract.\n *\n * Emits an {IERC1967-Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n _setImplementation(newImplementation);\n emit IERC1967.Upgraded(newImplementation);\n\n if (data.length > 0) {\n Address.functionDelegateCall(newImplementation, data);\n } else {\n _checkNonPayable();\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the ERC-1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n if (newAdmin == address(0)) {\n revert ERC1967InvalidAdmin(address(0));\n }\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {IERC1967-AdminChanged} event.\n */\n function changeAdmin(address newAdmin) internal {\n emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the ERC-1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n if (newBeacon.code.length == 0) {\n revert ERC1967InvalidBeacon(newBeacon);\n }\n\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n address beaconImplementation = IBeacon(newBeacon).implementation();\n if (beaconImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(beaconImplementation);\n }\n }\n\n /**\n * @dev Change the beacon and trigger a setup call if data is nonempty.\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n * to avoid stuck value in the contract.\n *\n * Emits an {IERC1967-BeaconUpgraded} event.\n *\n * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n * efficiency.\n */\n function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n _setBeacon(newBeacon);\n emit IERC1967.BeaconUpgraded(newBeacon);\n\n if (data.length > 0) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n } else {\n _checkNonPayable();\n }\n }\n\n /**\n * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n * if an upgrade doesn't perform an initialization call.\n */\n function _checkNonPayable() private {\n if (msg.value > 0) {\n revert ERC1967NonPayable();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback\n * function and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Storage of the initializable contract.\n *\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n * when using with upgradeable contracts.\n *\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n */\n struct InitializableStorage {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n uint64 _initialized;\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool _initializing;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n /**\n * @dev The contract is already initialized.\n */\n error InvalidInitialization();\n\n /**\n * @dev The contract is not initializing.\n */\n error NotInitializing();\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint64 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n * production.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n // Cache values to avoid duplicated sloads\n bool isTopLevelCall = !$._initializing;\n uint64 initialized = $._initialized;\n\n // Allowed calls:\n // - initialSetup: the contract is not in the initializing state and no previous version was\n // initialized\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\n // current contract is just being deployed\n bool initialSetup = initialized == 0 && isTopLevelCall;\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n $._initialized = 1;\n if (isTopLevelCall) {\n $._initializing = true;\n }\n _;\n if (isTopLevelCall) {\n $._initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint64 version) {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n $._initialized = version;\n $._initializing = true;\n _;\n $._initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n _checkInitializing();\n _;\n }\n\n /**\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n */\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n emit Initialized(type(uint64).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n /**\n * @dev Returns a pointer to the storage namespace.\n */\n // solhint-disable-next-line var-name-mixedcase\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n assembly {\n $.slot := INITIALIZABLE_STORAGE\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC1822Proxiable} from \"../../interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"../ERC1967/ERC1967Utils.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable __self = address(this);\n\n /**\n * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n * during an upgrade.\n */\n string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n /**\n * @dev The call is from an unauthorized context.\n */\n error UUPSUnauthorizedCallContext();\n\n /**\n * @dev The storage `slot` is unsupported as a UUID.\n */\n error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n _checkProxy();\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n _checkNotDelegated();\n _;\n }\n\n /**\n * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n return ERC1967Utils.IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n *\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data);\n }\n\n /**\n * @dev Reverts if the execution is not performed via delegatecall or the execution\n * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n * See {_onlyProxy}.\n */\n function _checkProxy() internal view virtual {\n if (\n address(this) == __self || // Must be called through delegatecall\n ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n ) {\n revert UUPSUnauthorizedCallContext();\n }\n }\n\n /**\n * @dev Reverts if the execution is performed via delegatecall.\n * See {notDelegated}.\n */\n function _checkNotDelegated() internal view virtual {\n if (address(this) != __self) {\n // Must not be called through delegatecall\n revert UUPSUnauthorizedCallContext();\n }\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n *\n * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n * is expected to be the implementation slot in ERC-1967.\n *\n * Emits an {IERC1967-Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n revert UUPSUnsupportedProxiableUUID(slot);\n }\n ERC1967Utils.upgradeToAndCall(newImplementation, data);\n } catch {\n // The implementation is not UUPS\n revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Create2.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev There's no code to deploy.\n */\n error Create2EmptyBytecode();\n\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n if (bytecode.length == 0) {\n revert Create2EmptyBytecode();\n }\n assembly (\"memory-safe\") {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n // if no address was created, and returndata is not empty, bubble revert\n if and(iszero(addr), not(iszero(returndatasize()))) {\n let p := mload(0x40)\n returndatacopy(p, 0, returndatasize())\n revert(p, returndatasize())\n }\n }\n if (addr == address(0)) {\n revert Errors.FailedDeployment();\n }\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := and(keccak256(start, 85), 0xffffffffffffffffffffffffffffffffffffffff)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS\n }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n */\n function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n assembly (\"memory-safe\") {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n uint256 localValue = value;\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n * representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "contracts/PublicKeyRegistry.sol": { + "content": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity ^0.8.27;\n\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract PublicKeyRegistry is Ownable(msg.sender) {\n /// providerId => publicKeyHash => isValid\n mapping(bytes32 => mapping(bytes32 => bool)) public isPublicKeyHashValid;\n\n function setPublicKeyValid(\n bytes32 providerId,\n bytes32 publicKeyHash,\n bool valid\n ) external onlyOwner {\n isPublicKeyHashValid[providerId][publicKeyHash] = valid;\n }\n\n struct PublicKeyValidity {\n bytes32 providerId;\n bytes32 publicKeyHash;\n bool valid;\n }\n\n function setPublicKeysValid(\n PublicKeyValidity[] calldata validity\n ) external onlyOwner {\n for (uint256 i = 0; i < validity.length; i++) {\n PublicKeyValidity calldata v = validity[i];\n isPublicKeyHashValid[v.providerId][v.publicKeyHash] = v.valid;\n }\n }\n\n function checkPublicKey(\n bytes32 providerId,\n bytes32 publicKeyHash\n ) external view returns (bool) {\n return isPublicKeyHashValid[providerId][publicKeyHash];\n }\n}\n" + }, + "contracts/SimpleAccount.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.23;\n\n/* solhint-disable avoid-low-level-calls */\n/* solhint-disable no-inline-assembly */\n/* solhint-disable reason-string */\n\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@account-abstraction/contracts/core/BaseAccount.sol\";\nimport \"@account-abstraction/contracts/core/Helpers.sol\";\nimport \"@account-abstraction/contracts/samples/callback/TokenCallbackHandler.sol\";\n\nimport {PublicKeyRegistry} from \"./PublicKeyRegistry.sol\";\nimport {ZkLogin} from \"./ZkLogin.sol\";\n\n// Note: keep in sync with JS\n// How long owner session is valid for\nuint96 constant OWNER_EXPIRATION_TIME = 24 hours;\n\n// Note: keep in sync with JS\n// How long a jwt is valid for\nuint256 constant JWT_EXPIRATION_TIME = 1 hours;\n\n/**\n * minimal account.\n * this is sample minimal account.\n * has execute, eth handling methods\n * has a single signer that can send requests through the entryPoint.\n */\ncontract SimpleAccount is\n BaseAccount,\n TokenCallbackHandler,\n UUPSUpgradeable,\n Initializable\n{\n IEntryPoint private immutable _entryPoint;\n\n struct Owner {\n address owner;\n uint96 expirationTimestamp;\n }\n Owner public ownerInfo;\n\n ZkLogin.AccountData public accountData;\n\n constructor(IEntryPoint anEntryPoint) {\n _entryPoint = anEntryPoint;\n _disableInitializers();\n }\n\n /**\n * @dev The _entryPoint member is immutable, to reduce gas consumption. To upgrade EntryPoint,\n * a new implementation of SimpleAccount must be deployed with the new EntryPoint address, then upgrading\n * the implementation by calling `upgradeTo()`\n */\n function initialize(\n ZkLogin.AccountData calldata accountData_\n ) public virtual initializer {\n accountData = accountData_;\n }\n\n /// implement template method of BaseAccount\n function _validateSignature(\n PackedUserOperation calldata userOp,\n bytes32 userOpHash\n ) internal virtual override returns (uint256 validationData) {\n bytes32 hash = MessageHashUtils.toEthSignedMessageHash(userOpHash);\n if (currentOwner() != ECDSA.recover(hash, userOp.signature))\n return SIG_VALIDATION_FAILED;\n return SIG_VALIDATION_SUCCESS;\n }\n\n function validateUserOp(\n PackedUserOperation calldata userOp,\n bytes32 userOpHash,\n uint256 missingAccountFunds\n ) external virtual override returns (uint256 validationData) {\n if (bytes4(userOp.callData) == this.setOwner.selector) {\n // because it is a non-restricted function\n return SIG_VALIDATION_SUCCESS;\n }\n\n // copy-pasted from BaseAccount\n _requireFromEntryPoint();\n validationData = _validateSignature(userOp, userOpHash);\n _validateNonce(userOp.nonce);\n _payPrefund(missingAccountFunds);\n }\n\n function currentOwner() public view returns (address) {\n Owner memory ownerInfo_ = ownerInfo;\n if (block.timestamp > ownerInfo_.expirationTimestamp) {\n return address(0);\n }\n return ownerInfo_.owner;\n }\n\n function setOwner(\n ZkLogin.VerificationData calldata verificationData\n ) public {\n require(\n verificationData.jwtIat + JWT_EXPIRATION_TIME >= block.timestamp,\n \"JwtAccount: expired proof\"\n );\n bool result = ZkLogin.verifyProof(accountData, verificationData);\n require(result, \"JwtAccount: invalid proof\");\n\n ownerInfo = Owner({\n owner: address(uint160(uint256(verificationData.jwtNonce))),\n expirationTimestamp: uint96(block.timestamp) + OWNER_EXPIRATION_TIME\n });\n }\n\n function _call(address target, uint256 value, bytes memory data) internal {\n (bool success, bytes memory result) = target.call{value: value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }\n\n /**\n * execute a transaction (called directly from owner, or by entryPoint)\n * @param dest destination address to call\n * @param value the value to pass in this call\n * @param func the calldata to pass in this call\n */\n function execute(\n address dest,\n uint256 value,\n bytes calldata func\n ) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n\n /// @notice Represents a call to make.\n struct Call {\n /// @dev The address to call.\n address target;\n /// @dev The value to send when making the call.\n uint256 value;\n /// @dev The data of the call.\n bytes data;\n }\n\n /**\n * execute a sequence of transactions\n */\n function executeBatch(Call[] calldata calls) external {\n _requireFromEntryPointOrOwner();\n for (uint256 i; i < calls.length; i++) {\n _call(calls[i].target, calls[i].value, calls[i].data);\n }\n }\n\n /**\n * check current account deposit in the entryPoint\n */\n function getDeposit() public view returns (uint256) {\n return entryPoint().balanceOf(address(this));\n }\n\n /**\n * deposit more funds for this account in the entryPoint\n */\n function addDeposit() public payable {\n entryPoint().depositTo{value: msg.value}(address(this));\n }\n\n /**\n * withdraw value from the account's deposit\n * @param withdrawAddress target to send to\n * @param amount to withdraw\n */\n function withdrawDepositTo(\n address payable withdrawAddress,\n uint256 amount\n ) public onlyOwner {\n entryPoint().withdrawTo(withdrawAddress, amount);\n }\n\n // Require the function call went through EntryPoint or owner\n function _requireFromEntryPointOrOwner() internal view {\n require(\n msg.sender == address(entryPoint()) || msg.sender == currentOwner(),\n \"account: not Owner or EntryPoint\"\n );\n }\n\n /// @inheritdoc BaseAccount\n function entryPoint() public view virtual override returns (IEntryPoint) {\n return _entryPoint;\n }\n\n modifier onlyOwner() {\n _onlyOwner();\n _;\n }\n\n function _onlyOwner() internal view {\n //directly from EOA owner, or through the account itself (which gets redirected through execute())\n require(\n msg.sender == currentOwner() || msg.sender == address(this),\n \"only owner\"\n );\n }\n\n // solhint-disable-next-line no-empty-blocks\n receive() external payable {}\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal view override {\n (newImplementation);\n _onlyOwner();\n }\n}\n" + }, + "contracts/SimpleAccountFactory.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\n\nimport {SimpleAccount, IEntryPoint} from \"./SimpleAccount.sol\";\nimport {PublicKeyRegistry} from \"./PublicKeyRegistry.sol\";\nimport {ZkLogin} from \"./ZkLogin.sol\";\n\n/**\n * A sample factory contract for SimpleAccount\n * A UserOperations \"initCode\" holds the address of the factory, and a method call (to createAccount, in this sample factory).\n * The factory's createAccount returns the target account address even if it is already installed.\n * This way, the entryPoint.getSenderAddress() can be called either before or after the account is created.\n */\ncontract SimpleAccountFactory {\n SimpleAccount public immutable accountImplementation;\n\n constructor(IEntryPoint _entryPoint) {\n accountImplementation = new SimpleAccount(_entryPoint);\n }\n\n /**\n * create an account, and return its address.\n * returns the address even if the account is already deployed.\n * Note that during UserOperation execution, this method is called only if the account is not deployed.\n * This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation\n */\n function createAccount(\n ZkLogin.AccountData calldata params\n ) public returns (SimpleAccount ret) {\n // TODO: create2 address should depend only on accountId and jwt.aud (and maybe \"jwt.iss\"?)\n ret = SimpleAccount(\n payable(\n new ERC1967Proxy{salt: bytes32(0)}(\n address(accountImplementation),\n abi.encodeCall(SimpleAccount.initialize, params)\n )\n )\n );\n }\n\n /**\n * calculate the counterfactual address of this account as it would be returned by createAccount()\n */\n function getAccountAddress(\n ZkLogin.AccountData calldata params\n ) public view returns (address) {\n return\n Create2.computeAddress(\n bytes32(0),\n keccak256(\n abi.encodePacked(\n type(ERC1967Proxy).creationCode,\n abi.encode(\n address(accountImplementation),\n abi.encodeCall(SimpleAccount.initialize, (params))\n )\n )\n )\n );\n }\n}\n" + }, + "contracts/Strings.sol": { + "content": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity ^0.8.27;\n\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n function toHexStringWithoutPrefix(\n uint256 value,\n uint256 length\n ) internal pure returns (string memory) {\n uint256 localValue = value;\n bytes memory buffer = new bytes(2 * length);\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i - 2] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\n return string(buffer);\n }\n\n function toHexStringWithoutPrefix(\n bytes32 value\n ) internal pure returns (string memory) {\n return toHexStringWithoutPrefix(uint256(value), 32);\n }\n}\n" + }, + "contracts/TestJwtAccount.sol": { + "content": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity ^0.8.27;\n\nimport {ZkLogin} from \"./ZkLogin.sol\";\nimport {PublicKeyRegistry} from \"./PublicKeyRegistry.sol\";\n\ncontract TestJwtAccount {\n ZkLogin.AccountData public accountData;\n\n constructor(ZkLogin.AccountData memory accountData_) {\n accountData = accountData_;\n }\n\n function verify(\n ZkLogin.VerificationData calldata verificationData\n ) external {\n bool result = ZkLogin.verifyProof(accountData, verificationData);\n require(result, \"JwtAccount: invalid proof\");\n }\n}\n" + }, + "contracts/ZkLogin.sol": { + "content": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity ^0.8.27;\n\nimport {HonkVerifier} from \"../noir/target/jwt_account_honk.sol\";\nimport {Strings} from \"./Strings.sol\";\nimport {PublicKeyRegistry} from \"./PublicKeyRegistry.sol\";\n\nlibrary ZkLogin {\n struct AccountData {\n bytes32 accountId;\n bytes32 authProviderId;\n PublicKeyRegistry publicKeyRegistry;\n HonkVerifier proofVerifier;\n }\n\n struct VerificationData {\n bytes proof;\n uint256 jwtIat;\n bytes32 jwtNonce;\n bytes32 publicKeyHash;\n }\n\n function verifyProof(\n AccountData memory accountData,\n VerificationData memory verificationData\n ) internal view returns (bool) {\n require(\n accountData.publicKeyRegistry.checkPublicKey(\n accountData.authProviderId,\n verificationData.publicKeyHash\n ),\n \"public key hash mismatch\"\n );\n\n bytes memory jwtNonce = bytes(\n Strings.toHexStringWithoutPrefix(verificationData.jwtNonce)\n );\n\n uint256 staticInputLength = 3;\n bytes32[] memory publicInputs = new bytes32[](\n staticInputLength + jwtNonce.length\n );\n uint256 j = 0;\n publicInputs[j++] = accountData.accountId;\n publicInputs[j++] = bytes32(verificationData.jwtIat);\n publicInputs[j++] = verificationData.publicKeyHash;\n\n for (uint256 i = 0; i < jwtNonce.length; i++) {\n publicInputs[j++] = bytes32(uint256(uint8(jwtNonce[i])));\n }\n\n return\n accountData.proofVerifier.verify(\n verificationData.proof,\n publicInputs\n );\n }\n}\n" + }, + "noir/target/jwt_account_honk.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n// Copyright 2022 Aztec\npragma solidity >=0.8.21;\n\nuint256 constant N = 262144;\nuint256 constant LOG_N = 18;\nuint256 constant NUMBER_OF_PUBLIC_INPUTS = 67;\nlibrary HonkVerificationKey {\n function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) {\n Honk.VerificationKey memory vk = Honk.VerificationKey({\n circuitSize: uint256(262144),\n logCircuitSize: uint256(18),\n publicInputsSize: uint256(67),\n ql: Honk.G1Point({ \n x: uint256(0x128f4689193e8d7e352ac5f0afe29ff277d1b8b08807981784a590b82a9b5e2e),\n y: uint256(0x1aa8be7d44f5bf4c12440bd390aeb102e211af54f0c176e5a7aaecdf49543574)\n }),\n qr: Honk.G1Point({ \n x: uint256(0x2b0a33558c2603b6bc43635665be9da0f5e2f623bea9e22dd055c74324d7f122),\n y: uint256(0x162d39578897a70f2dc851710de29d3dd6fae4e768f2c841aa7b95834ceae5cb)\n }),\n qo: Honk.G1Point({ \n x: uint256(0x262d979b29df1669541daa3f02157701ff7ab07a6f5317d2e4d1c4c2106e17e3),\n y: uint256(0x06af46ef2dc4282de259c7e02867c3c77a799af864e2370f61a8f1aec7a7f409)\n }),\n q4: Honk.G1Point({ \n x: uint256(0x0e45f7edf0975574a0234a5c0510af9251c52534b527f8af7bd17a4c60959096),\n y: uint256(0x2053c39f8961e378924eb488270ae9caab9db0bbf2d2937c0fef89a40000d214)\n }),\n qm: Honk.G1Point({ \n x: uint256(0x0000000000000000000000000000000000000000000000000000000000000000),\n y: uint256(0x0000000000000000000000000000000000000000000000000000000000000000)\n }),\n qc: Honk.G1Point({ \n x: uint256(0x0023296072ba882e23ed90ee1dac8eedbb30e5b4fbbf6a8be14cc97eaa446693),\n y: uint256(0x1540513d0b8971ae7c56b28838a830801b04cc4f3a3dde06c3eac3410a2ee9c4)\n }),\n qArith: Honk.G1Point({ \n x: uint256(0x24792fa51f5beafb9c4eff1a8bf1a9a6ccd9a02877d64ec78becc03bc9f7d1ff),\n y: uint256(0x2b3a9b5ddd9cf49b41974c5cb73e39997fd915a8df5b8458fa08d02a55a96443)\n }),\n qDeltaRange: Honk.G1Point({ \n x: uint256(0x1df1862c3cd967cf4e80a289e6fec969049ae11aac5a796ac650315d22e580fb),\n y: uint256(0x2afb83456939046324306525332ef3307638d6766ff90e40559aa45e471b871b)\n }),\n qElliptic: Honk.G1Point({ \n x: uint256(0x286ee766413caa93518a7570875801a9159d2e1315c1ab5bc9e52595a830c495),\n y: uint256(0x045175bd839a41eda5e9b6a40f76bbbf2723a68e1e7ecd739bd97ae093cd6528)\n }),\n qAux: Honk.G1Point({ \n x: uint256(0x1c2f84adf95896cf0018ae79ebbdeb2468b1404953a855ec2facc4b494495433),\n y: uint256(0x0a175b5ba1452877e6cb7ac6ca850788f7e17a56f310cb5f18d9642b7bdcbcf2)\n }),\n qLookup: Honk.G1Point({ \n x: uint256(0x22ffd03e53836f0a9271398e34a792953979926b49a76c967c71cc8af35e04bb),\n y: uint256(0x02e2ae071779429f971820e5d680764ae55b0a0db4bc14709d47abc261cfe64c)\n }),\n qPoseidon2External: Honk.G1Point({ \n x: uint256(0x034ab86a5bccfa4f69637da232ba777f403c1aeb69ad6040d432a795e1b382c2),\n y: uint256(0x09a353e2a34ad0af28688dbf4c01cc7de2c9878d6a1b80ce58e567d6c48b5bec)\n }),\n qPoseidon2Internal: Honk.G1Point({ \n x: uint256(0x1a65519a1ab82173d9cb9dc061f62c9d53ef95915b0cc76feb9feb90351e810d),\n y: uint256(0x29c0afd9c7eeae8e1635b3835090d59d5344bd56cf3c71487adcf6d8c5844348)\n }),\n s1: Honk.G1Point({ \n x: uint256(0x139c2f5bba86aea351df6608e3f1cd26b3c0b4371dca357e701a6025f94be1e7),\n y: uint256(0x22399eb57ad19a4409a194335726da4d76a0cf2d0d89a50dbc7f687de1aad8c3)\n }),\n s2: Honk.G1Point({ \n x: uint256(0x0ff16a5ae01ecffc7815eb75c174ad14281aa49059929907518634d841c628f5),\n y: uint256(0x2d867f1d311969273bc82b184e63d9269b182a881d3b302b242a4dc93462f7b7)\n }),\n s3: Honk.G1Point({ \n x: uint256(0x0821760c77fc15784afcaff815f73f8f90aa38ebe34d3b48695e3a6ad08ed8b0),\n y: uint256(0x2f51bc8941e5c577f7ec1d5bb038bd902c7a5c7dd1389bab38b9c89ec4ab7d29)\n }),\n s4: Honk.G1Point({ \n x: uint256(0x0ffd51787978d66be3b7e70e810c4575178c9f45674db1b870595ce7e2fb5f6f),\n y: uint256(0x17a63d56e53061da2fe13b311859cb536d18d6060100c393c5bb9251dfbad74a)\n }),\n t1: Honk.G1Point({ \n x: uint256(0x234c57b9aab8dfb66855cbb2ed5c7dcaa724527a8b5abae05dbfc771da6679cc),\n y: uint256(0x22060d556338e2843aed696c8fc98bf0c6d133543b5c8774daf51221e0eafb44)\n }),\n t2: Honk.G1Point({ \n x: uint256(0x2c931d2ddd0a37bf249ba13d4c0005dcf10f905b44f587692f7e19c4325beece),\n y: uint256(0x02d3dc1f3ed31519bae6c333e090615800a04cfdc9d6233f823114a44746d501)\n }),\n t3: Honk.G1Point({ \n x: uint256(0x06246fd4811f690574ddc55745590439a8f73455e78fdd3521d65c7e007e6b45),\n y: uint256(0x1e132a30f5aa1d892595234280dd91b7728b3dadc7b72e58f2a95148f38ba210)\n }),\n t4: Honk.G1Point({ \n x: uint256(0x1e0181f12b41a00b4ee891ed5a942bfdbae834b4faf95ce9e9aaa9bd2500ce63),\n y: uint256(0x1b6f032aa6b07625de54649d25628c9a5c45ab7c6c13a88fdd31ca7ecce024af)\n }),\n id1: Honk.G1Point({ \n x: uint256(0x024dcf715a66fd964f629553ae2bcb51c127b813ed7f9a4b28b481fb9e2c3772),\n y: uint256(0x20244a5d7222400941070d0355a58d34ab8ff9b0d8935fd8c9225059f13fcaac)\n }),\n id2: Honk.G1Point({ \n x: uint256(0x02987fe7cdb3cab8ebf18ecc8711b792828a0670bd9bcd17442c4a157325c8ef),\n y: uint256(0x1c9fa626c623b3102d77b2878a9de76dd9a1837521baa49c6874797a8e5a9626)\n }),\n id3: Honk.G1Point({ \n x: uint256(0x130b070560870337eb165683645e3c8522d6449e1367a35c5cf00dd4462fd967),\n y: uint256(0x01fe23c3926178b337c362c53b74d2233d08cf587bb0f114ebfe21542c9645e5)\n }),\n id4: Honk.G1Point({ \n x: uint256(0x153a7f8639e06461474e00018cde1ac1acf38089893c5515de20804922c03219),\n y: uint256(0x0939c3d22ab03cefb504fe214af93d65912ae3750ce6b756b0e02c9ce7a16e68)\n }),\n lagrangeFirst: Honk.G1Point({ \n x: uint256(0x19b09aa2fcb34ae480845aa4ad56e01616ae845300e6f676fdb84f4bd396851b),\n y: uint256(0x295d8a6bfcce573b23d5eefd0aab6d32479423acd4956ce6deb5a67073f032d5)\n }),\n lagrangeLast: Honk.G1Point({ \n x: uint256(0x08d314a75c6b1f82d70f2edc7b7bf6e7397bc04bc6aaa0584b9e5bbb7689082b),\n y: uint256(0x0100000000000000000000000000000000000000000000000000000000000000)\n })\n });\n return vk;\n }\n}\n\npragma solidity ^0.8.27;\n\ntype Fr is uint256;\n\nusing { add as + } for Fr global;\nusing { sub as - } for Fr global;\nusing { mul as * } for Fr global;\nusing { exp as ^ } for Fr global;\nusing { notEqual as != } for Fr global;\nusing { equal as == } for Fr global;\n\nuint256 constant MODULUS =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617; // Prime field order\n\nFr constant MINUS_ONE = Fr.wrap(MODULUS - 1);\n\n// Instantiation\nlibrary FrLib\n{\n function from(uint256 value) internal pure returns(Fr)\n {\n return Fr.wrap(value % MODULUS);\n }\n\n function fromBytes32(bytes32 value) internal pure returns(Fr)\n {\n return Fr.wrap(uint256(value) % MODULUS);\n }\n\n function toBytes32(Fr value) internal pure returns(bytes32)\n {\n return bytes32(Fr.unwrap(value));\n }\n\n function invert(Fr value) internal view returns(Fr)\n {\n uint256 v = Fr.unwrap(value);\n uint256 result;\n\n // Call the modexp precompile to invert in the field\n assembly\n {\n let free := mload(0x40)\n mstore(free, 0x20)\n mstore(add(free, 0x20), 0x20)\n mstore(add(free, 0x40), 0x20)\n mstore(add(free, 0x60), v)\n mstore(add(free, 0x80), sub(MODULUS, 2))\n mstore(add(free, 0xa0), MODULUS)\n let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)\n if iszero(success) {\n revert(0, 0)\n }\n result := mload(0x00)\n }\n\n return Fr.wrap(result);\n }\n\n function pow(Fr base, uint256 v) internal view returns(Fr)\n {\n uint256 b = Fr.unwrap(base);\n uint256 result;\n\n // Call the modexp precompile to invert in the field\n assembly\n {\n let free := mload(0x40)\n mstore(free, 0x20)\n mstore(add(free, 0x20), 0x20)\n mstore(add(free, 0x40), 0x20)\n mstore(add(free, 0x60), b)\n mstore(add(free, 0x80), v)\n mstore(add(free, 0xa0), MODULUS)\n let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)\n if iszero(success) {\n revert(0, 0)\n }\n result := mload(0x00)\n }\n\n return Fr.wrap(result);\n }\n\n function div(Fr numerator, Fr denominator) internal view returns(Fr)\n {\n return numerator * invert(denominator);\n }\n\n function sqr(Fr value) internal pure returns (Fr) {\n return value * value;\n }\n\n function unwrap(Fr value) internal pure returns (uint256) {\n return Fr.unwrap(value);\n }\n\n function neg(Fr value) internal pure returns (Fr) {\n return Fr.wrap(MODULUS - Fr.unwrap(value));\n }\n}\n\n// Free functions\nfunction add(Fr a, Fr b) pure returns(Fr)\n{\n return Fr.wrap(addmod(Fr.unwrap(a), Fr.unwrap(b), MODULUS));\n}\n\nfunction mul(Fr a, Fr b) pure returns(Fr)\n{\n return Fr.wrap(mulmod(Fr.unwrap(a), Fr.unwrap(b), MODULUS));\n}\n\nfunction sub(Fr a, Fr b) pure returns(Fr)\n{\n return Fr.wrap(addmod(Fr.unwrap(a), MODULUS - Fr.unwrap(b), MODULUS));\n}\n\nfunction exp(Fr base, Fr exponent) pure returns(Fr)\n{\n if (Fr.unwrap(exponent) == 0) return Fr.wrap(1);\n\n for (uint256 i = 1; i < Fr.unwrap(exponent); i += i) {\n base = base * base;\n }\n return base;\n}\n\nfunction notEqual(Fr a, Fr b) pure returns(bool)\n{\n return Fr.unwrap(a) != Fr.unwrap(b);\n}\n\nfunction equal(Fr a, Fr b) pure returns(bool)\n{\n return Fr.unwrap(a) == Fr.unwrap(b);\n}\n\nuint256 constant CONST_PROOF_SIZE_LOG_N = 28;\n\nuint256 constant NUMBER_OF_SUBRELATIONS = 26;\nuint256 constant BATCHED_RELATION_PARTIAL_LENGTH = 8;\nuint256 constant NUMBER_OF_ENTITIES = 44;\nuint256 constant NUMBER_UNSHIFTED = 35;\nuint256 constant NUMBER_TO_BE_SHIFTED = 9;\n\n// Alphas are used as relation separators so there should be NUMBER_OF_SUBRELATIONS - 1\nuint256 constant NUMBER_OF_ALPHAS = 25;\n\n// Prime field order\nuint256 constant Q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; // EC group order. F_q\nuint256 constant P = 21888242871839275222246405745257275088548364400416034343698204186575808495617; // Prime field order, F_r\n\n// ENUM FOR WIRES\nenum WIRE {\n Q_M,\n Q_C,\n Q_L,\n Q_R,\n Q_O,\n Q_4,\n Q_ARITH,\n Q_RANGE,\n Q_ELLIPTIC,\n Q_AUX,\n Q_LOOKUP,\n Q_POSEIDON2_EXTERNAL,\n Q_POSEIDON2_INTERNAL,\n SIGMA_1,\n SIGMA_2,\n SIGMA_3,\n SIGMA_4,\n ID_1,\n ID_2,\n ID_3,\n ID_4,\n TABLE_1,\n TABLE_2,\n TABLE_3,\n TABLE_4,\n LAGRANGE_FIRST,\n LAGRANGE_LAST,\n W_L,\n W_R,\n W_O,\n W_4,\n Z_PERM,\n LOOKUP_INVERSES,\n LOOKUP_READ_COUNTS,\n LOOKUP_READ_TAGS,\n TABLE_1_SHIFT,\n TABLE_2_SHIFT,\n TABLE_3_SHIFT,\n TABLE_4_SHIFT,\n W_L_SHIFT,\n W_R_SHIFT,\n W_O_SHIFT,\n W_4_SHIFT,\n Z_PERM_SHIFT\n}\n\nlibrary Honk {\n struct G1Point {\n uint256 x;\n uint256 y;\n }\n\n struct G1ProofPoint {\n uint256 x_0;\n uint256 x_1;\n uint256 y_0;\n uint256 y_1;\n }\n\n struct VerificationKey {\n // Misc Params\n uint256 circuitSize;\n uint256 logCircuitSize;\n uint256 publicInputsSize;\n // Selectors\n G1Point qm;\n G1Point qc;\n G1Point ql;\n G1Point qr;\n G1Point qo;\n G1Point q4;\n G1Point qArith; // Arithmetic widget\n G1Point qDeltaRange; // Delta Range sort\n G1Point qAux; // Auxillary\n G1Point qElliptic; // Auxillary\n G1Point qLookup; // Lookup\n G1Point qPoseidon2External;\n G1Point qPoseidon2Internal;\n // Copy cnstraints\n G1Point s1;\n G1Point s2;\n G1Point s3;\n G1Point s4;\n // Copy identity\n G1Point id1;\n G1Point id2;\n G1Point id3;\n G1Point id4;\n // Precomputed lookup table\n G1Point t1;\n G1Point t2;\n G1Point t3;\n G1Point t4;\n // Fixed first and last\n G1Point lagrangeFirst;\n G1Point lagrangeLast;\n }\n\n struct Proof {\n uint256 circuitSize;\n uint256 publicInputsSize;\n uint256 publicInputsOffset;\n // Free wires\n Honk.G1ProofPoint w1;\n Honk.G1ProofPoint w2;\n Honk.G1ProofPoint w3;\n Honk.G1ProofPoint w4;\n // Lookup helpers - Permutations\n Honk.G1ProofPoint zPerm;\n // Lookup helpers - logup\n Honk.G1ProofPoint lookupReadCounts;\n Honk.G1ProofPoint lookupReadTags;\n Honk.G1ProofPoint lookupInverses;\n // Sumcheck\n Fr[BATCHED_RELATION_PARTIAL_LENGTH][CONST_PROOF_SIZE_LOG_N] sumcheckUnivariates;\n Fr[NUMBER_OF_ENTITIES] sumcheckEvaluations;\n // Shplemini\n Honk.G1ProofPoint[CONST_PROOF_SIZE_LOG_N - 1] geminiFoldComms;\n Fr[CONST_PROOF_SIZE_LOG_N] geminiAEvaluations;\n Honk.G1ProofPoint shplonkQ;\n Honk.G1ProofPoint kzgQuotient;\n }\n}\n\n\n// Transcript library to generate fiat shamir challenges\nstruct Transcript {\n Fr eta;\n Fr etaTwo;\n Fr etaThree;\n Fr beta;\n Fr gamma;\n Fr[NUMBER_OF_ALPHAS] alphas;\n Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges;\n Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges;\n // Shplemini\n Fr rho;\n Fr geminiR;\n Fr shplonkNu;\n Fr shplonkZ;\n // Derived\n Fr publicInputsDelta;\n}\n\nlibrary TranscriptLib {\n function generateTranscript(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize)\n internal\n pure\n returns (Transcript memory t)\n {\n Fr previousChallenge;\n (t.eta, t.etaTwo, t.etaThree, previousChallenge) = generateEtaChallenge(proof, publicInputs, publicInputsSize);\n\n (t.beta, t.gamma, previousChallenge) = generateBetaAndGammaChallenges(previousChallenge, proof);\n\n (t.alphas, previousChallenge) = generateAlphaChallenges(previousChallenge, proof);\n\n (t.gateChallenges, previousChallenge) = generateGateChallenges(previousChallenge);\n\n (t.sumCheckUChallenges, previousChallenge) = generateSumcheckChallenges(proof, previousChallenge);\n\n (t.rho, previousChallenge) = generateRhoChallenge(proof, previousChallenge);\n\n (t.geminiR, previousChallenge) = generateGeminiRChallenge(proof, previousChallenge);\n\n (t.shplonkNu, previousChallenge) = generateShplonkNuChallenge(proof, previousChallenge);\n\n (t.shplonkZ, previousChallenge) = generateShplonkZChallenge(proof, previousChallenge);\n\n return t;\n }\n\n function splitChallenge(Fr challenge) internal pure returns (Fr first, Fr second) {\n uint256 challengeU256 = uint256(Fr.unwrap(challenge));\n uint256 lo = challengeU256 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;\n uint256 hi = challengeU256 >> 128;\n first = FrLib.fromBytes32(bytes32(lo));\n second = FrLib.fromBytes32(bytes32(hi));\n }\n\n function generateEtaChallenge(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize)\n internal\n pure\n returns (Fr eta, Fr etaTwo, Fr etaThree, Fr previousChallenge)\n {\n bytes32[] memory round0 = new bytes32[](3 + publicInputsSize + 12);\n round0[0] = bytes32(proof.circuitSize);\n round0[1] = bytes32(proof.publicInputsSize);\n round0[2] = bytes32(proof.publicInputsOffset);\n for (uint256 i = 0; i < publicInputsSize; i++) {\n round0[3 + i] = bytes32(publicInputs[i]);\n }\n\n // Create the first challenge\n // Note: w4 is added to the challenge later on\n round0[3 + publicInputsSize] = bytes32(proof.w1.x_0);\n round0[3 + publicInputsSize + 1] = bytes32(proof.w1.x_1);\n round0[3 + publicInputsSize + 2] = bytes32(proof.w1.y_0);\n round0[3 + publicInputsSize + 3] = bytes32(proof.w1.y_1);\n round0[3 + publicInputsSize + 4] = bytes32(proof.w2.x_0);\n round0[3 + publicInputsSize + 5] = bytes32(proof.w2.x_1);\n round0[3 + publicInputsSize + 6] = bytes32(proof.w2.y_0);\n round0[3 + publicInputsSize + 7] = bytes32(proof.w2.y_1);\n round0[3 + publicInputsSize + 8] = bytes32(proof.w3.x_0);\n round0[3 + publicInputsSize + 9] = bytes32(proof.w3.x_1);\n round0[3 + publicInputsSize + 10] = bytes32(proof.w3.y_0);\n round0[3 + publicInputsSize + 11] = bytes32(proof.w3.y_1);\n\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(round0)));\n (eta, etaTwo) = splitChallenge(previousChallenge);\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge))));\n Fr unused;\n (etaThree, unused) = splitChallenge(previousChallenge);\n }\n\n function generateBetaAndGammaChallenges(Fr previousChallenge, Honk.Proof memory proof)\n internal\n pure\n returns (Fr beta, Fr gamma, Fr nextPreviousChallenge)\n {\n bytes32[13] memory round1;\n round1[0] = FrLib.toBytes32(previousChallenge);\n round1[1] = bytes32(proof.lookupReadCounts.x_0);\n round1[2] = bytes32(proof.lookupReadCounts.x_1);\n round1[3] = bytes32(proof.lookupReadCounts.y_0);\n round1[4] = bytes32(proof.lookupReadCounts.y_1);\n round1[5] = bytes32(proof.lookupReadTags.x_0);\n round1[6] = bytes32(proof.lookupReadTags.x_1);\n round1[7] = bytes32(proof.lookupReadTags.y_0);\n round1[8] = bytes32(proof.lookupReadTags.y_1);\n round1[9] = bytes32(proof.w4.x_0);\n round1[10] = bytes32(proof.w4.x_1);\n round1[11] = bytes32(proof.w4.y_0);\n round1[12] = bytes32(proof.w4.y_1);\n\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(round1)));\n (beta, gamma) = splitChallenge(nextPreviousChallenge);\n }\n\n // Alpha challenges non-linearise the gate contributions\n function generateAlphaChallenges(Fr previousChallenge, Honk.Proof memory proof)\n internal\n pure\n returns (Fr[NUMBER_OF_ALPHAS] memory alphas, Fr nextPreviousChallenge)\n {\n // Generate the original sumcheck alpha 0 by hashing zPerm and zLookup\n uint256[9] memory alpha0;\n alpha0[0] = Fr.unwrap(previousChallenge);\n alpha0[1] = proof.lookupInverses.x_0;\n alpha0[2] = proof.lookupInverses.x_1;\n alpha0[3] = proof.lookupInverses.y_0;\n alpha0[4] = proof.lookupInverses.y_1;\n alpha0[5] = proof.zPerm.x_0;\n alpha0[6] = proof.zPerm.x_1;\n alpha0[7] = proof.zPerm.y_0;\n alpha0[8] = proof.zPerm.y_1;\n\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(alpha0)));\n (alphas[0], alphas[1]) = splitChallenge(nextPreviousChallenge);\n\n for (uint256 i = 1; i < NUMBER_OF_ALPHAS / 2; i++) {\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(nextPreviousChallenge))));\n (alphas[2 * i], alphas[2 * i + 1]) = splitChallenge(nextPreviousChallenge);\n }\n if (((NUMBER_OF_ALPHAS & 1) == 1) && (NUMBER_OF_ALPHAS > 2)) {\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(nextPreviousChallenge))));\n Fr unused;\n (alphas[NUMBER_OF_ALPHAS - 1], unused) = splitChallenge(nextPreviousChallenge);\n }\n }\n\n function generateGateChallenges(Fr previousChallenge)\n internal\n pure\n returns (Fr[CONST_PROOF_SIZE_LOG_N] memory gateChallenges, Fr nextPreviousChallenge)\n {\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\n previousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(Fr.unwrap(previousChallenge))));\n Fr unused;\n (gateChallenges[i], unused) = splitChallenge(previousChallenge);\n }\n nextPreviousChallenge = previousChallenge;\n }\n\n function generateSumcheckChallenges(Honk.Proof memory proof, Fr prevChallenge)\n internal\n pure\n returns (Fr[CONST_PROOF_SIZE_LOG_N] memory sumcheckChallenges, Fr nextPreviousChallenge)\n {\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\n Fr[BATCHED_RELATION_PARTIAL_LENGTH + 1] memory univariateChal;\n univariateChal[0] = prevChallenge;\n\n for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) {\n univariateChal[j + 1] = proof.sumcheckUnivariates[i][j];\n }\n prevChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(univariateChal)));\n Fr unused;\n (sumcheckChallenges[i], unused) = splitChallenge(prevChallenge);\n }\n nextPreviousChallenge = prevChallenge;\n }\n\n function generateRhoChallenge(Honk.Proof memory proof, Fr prevChallenge)\n internal\n pure\n returns (Fr rho, Fr nextPreviousChallenge)\n {\n Fr[NUMBER_OF_ENTITIES + 1] memory rhoChallengeElements;\n rhoChallengeElements[0] = prevChallenge;\n\n for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) {\n rhoChallengeElements[i + 1] = proof.sumcheckEvaluations[i];\n }\n\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(rhoChallengeElements)));\n Fr unused;\n (rho, unused) = splitChallenge(nextPreviousChallenge);\n }\n\n function generateGeminiRChallenge(Honk.Proof memory proof, Fr prevChallenge)\n internal\n pure\n returns (Fr geminiR, Fr nextPreviousChallenge)\n {\n uint256[(CONST_PROOF_SIZE_LOG_N - 1) * 4 + 1] memory gR;\n gR[0] = Fr.unwrap(prevChallenge);\n\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) {\n gR[1 + i * 4] = proof.geminiFoldComms[i].x_0;\n gR[2 + i * 4] = proof.geminiFoldComms[i].x_1;\n gR[3 + i * 4] = proof.geminiFoldComms[i].y_0;\n gR[4 + i * 4] = proof.geminiFoldComms[i].y_1;\n }\n\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(gR)));\n Fr unused;\n (geminiR, unused) = splitChallenge(nextPreviousChallenge);\n }\n\n function generateShplonkNuChallenge(Honk.Proof memory proof, Fr prevChallenge)\n internal\n pure\n returns (Fr shplonkNu, Fr nextPreviousChallenge)\n {\n uint256[(CONST_PROOF_SIZE_LOG_N) + 1] memory shplonkNuChallengeElements;\n shplonkNuChallengeElements[0] = Fr.unwrap(prevChallenge);\n\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\n shplonkNuChallengeElements[i + 1] = Fr.unwrap(proof.geminiAEvaluations[i]);\n }\n\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(shplonkNuChallengeElements)));\n Fr unused;\n (shplonkNu, unused) = splitChallenge(nextPreviousChallenge);\n }\n\n function generateShplonkZChallenge(Honk.Proof memory proof, Fr prevChallenge)\n internal\n pure\n returns (Fr shplonkZ, Fr nextPreviousChallenge)\n {\n uint256[5] memory shplonkZChallengeElements;\n shplonkZChallengeElements[0] = Fr.unwrap(prevChallenge);\n\n shplonkZChallengeElements[1] = proof.shplonkQ.x_0;\n shplonkZChallengeElements[2] = proof.shplonkQ.x_1;\n shplonkZChallengeElements[3] = proof.shplonkQ.y_0;\n shplonkZChallengeElements[4] = proof.shplonkQ.y_1;\n\n nextPreviousChallenge = FrLib.fromBytes32(keccak256(abi.encodePacked(shplonkZChallengeElements)));\n Fr unused;\n (shplonkZ, unused) = splitChallenge(nextPreviousChallenge);\n }\n\n function loadProof(bytes calldata proof) internal pure returns (Honk.Proof memory) {\n Honk.Proof memory p;\n\n // Metadata\n p.circuitSize = uint256(bytes32(proof[0x00:0x20]));\n p.publicInputsSize = uint256(bytes32(proof[0x20:0x40]));\n p.publicInputsOffset = uint256(bytes32(proof[0x40:0x60]));\n\n // Commitments\n p.w1 = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x60:0x80])),\n x_1: uint256(bytes32(proof[0x80:0xa0])),\n y_0: uint256(bytes32(proof[0xa0:0xc0])),\n y_1: uint256(bytes32(proof[0xc0:0xe0]))\n });\n\n p.w2 = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0xe0:0x100])),\n x_1: uint256(bytes32(proof[0x100:0x120])),\n y_0: uint256(bytes32(proof[0x120:0x140])),\n y_1: uint256(bytes32(proof[0x140:0x160]))\n });\n p.w3 = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x160:0x180])),\n x_1: uint256(bytes32(proof[0x180:0x1a0])),\n y_0: uint256(bytes32(proof[0x1a0:0x1c0])),\n y_1: uint256(bytes32(proof[0x1c0:0x1e0]))\n });\n\n // Lookup / Permutation Helper Commitments\n p.lookupReadCounts = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x1e0:0x200])),\n x_1: uint256(bytes32(proof[0x200:0x220])),\n y_0: uint256(bytes32(proof[0x220:0x240])),\n y_1: uint256(bytes32(proof[0x240:0x260]))\n });\n p.lookupReadTags = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x260:0x280])),\n x_1: uint256(bytes32(proof[0x280:0x2a0])),\n y_0: uint256(bytes32(proof[0x2a0:0x2c0])),\n y_1: uint256(bytes32(proof[0x2c0:0x2e0]))\n });\n p.w4 = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x2e0:0x300])),\n x_1: uint256(bytes32(proof[0x300:0x320])),\n y_0: uint256(bytes32(proof[0x320:0x340])),\n y_1: uint256(bytes32(proof[0x340:0x360]))\n });\n p.lookupInverses = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x360:0x380])),\n x_1: uint256(bytes32(proof[0x380:0x3a0])),\n y_0: uint256(bytes32(proof[0x3a0:0x3c0])),\n y_1: uint256(bytes32(proof[0x3c0:0x3e0]))\n });\n p.zPerm = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[0x3e0:0x400])),\n x_1: uint256(bytes32(proof[0x400:0x420])),\n y_0: uint256(bytes32(proof[0x420:0x440])),\n y_1: uint256(bytes32(proof[0x440:0x460]))\n });\n\n // Boundary represents a pointer to the head of the unread part of the proof\n uint256 boundary = 0x460;\n\n // Sumcheck univariates\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\n // The loop boundary of i, this will shift forward on each evaluation\n uint256 loop_boundary = boundary + (i * 0x20 * BATCHED_RELATION_PARTIAL_LENGTH);\n\n for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) {\n uint256 start = loop_boundary + (j * 0x20);\n uint256 end = start + 0x20;\n p.sumcheckUnivariates[i][j] = FrLib.fromBytes32(bytes32(proof[start:end]));\n }\n }\n\n boundary = boundary + (CONST_PROOF_SIZE_LOG_N * BATCHED_RELATION_PARTIAL_LENGTH * 0x20);\n // Sumcheck evaluations\n for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) {\n uint256 start = boundary + (i * 0x20);\n uint256 end = start + 0x20;\n p.sumcheckEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end]));\n }\n\n boundary = boundary + (NUMBER_OF_ENTITIES * 0x20);\n\n // Gemini\n // Read gemini fold univariates\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) {\n uint256 xStart = boundary + (i * 0x80);\n uint256 xEnd = xStart + 0x20;\n\n uint256 x1Start = xEnd;\n uint256 x1End = x1Start + 0x20;\n\n uint256 yStart = x1End;\n uint256 yEnd = yStart + 0x20;\n\n uint256 y1Start = yEnd;\n uint256 y1End = y1Start + 0x20;\n p.geminiFoldComms[i] = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[xStart:xEnd])),\n x_1: uint256(bytes32(proof[x1Start:x1End])),\n y_0: uint256(bytes32(proof[yStart:yEnd])),\n y_1: uint256(bytes32(proof[y1Start:y1End]))\n });\n }\n\n boundary = boundary + ((CONST_PROOF_SIZE_LOG_N - 1) * 0x80);\n\n // Read gemini a evaluations\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) {\n uint256 start = boundary + (i * 0x20);\n uint256 end = start + 0x20;\n p.geminiAEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end]));\n }\n\n boundary = boundary + (CONST_PROOF_SIZE_LOG_N * 0x20);\n\n // Shplonk\n p.shplonkQ = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[boundary:boundary + 0x20])),\n x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])),\n y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])),\n y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80]))\n });\n\n boundary = boundary + 0x80;\n\n // KZG\n p.kzgQuotient = Honk.G1ProofPoint({\n x_0: uint256(bytes32(proof[boundary:boundary + 0x20])),\n x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])),\n y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])),\n y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80]))\n });\n\n return p;\n }\n}\n\n// EC Point utilities\nfunction convertProofPoint(Honk.G1ProofPoint memory input) pure returns (Honk.G1Point memory) {\n return Honk.G1Point({x: input.x_0 | (input.x_1 << 136), y: input.y_0 | (input.y_1 << 136)});\n}\n\nfunction ecMul(Honk.G1Point memory point, Fr scalar) view returns (Honk.G1Point memory) {\n bytes memory input = abi.encodePacked(point.x, point.y, Fr.unwrap(scalar));\n (bool success, bytes memory result) = address(0x07).staticcall(input);\n require(success, \"ecMul failed\");\n\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\n return Honk.G1Point({x: x, y: y});\n}\n\nfunction ecAdd(Honk.G1Point memory point0, Honk.G1Point memory point1) view returns (Honk.G1Point memory) {\n bytes memory input = abi.encodePacked(point0.x, point0.y, point1.x, point1.y);\n (bool success, bytes memory result) = address(0x06).staticcall(input);\n require(success, \"ecAdd failed\");\n\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\n return Honk.G1Point({x: x, y: y});\n}\n\nfunction ecSub(Honk.G1Point memory point0, Honk.G1Point memory point1) view returns (Honk.G1Point memory) {\n // We negate the second point\n uint256 negativePoint1Y = (Q - point1.y) % Q;\n bytes memory input = abi.encodePacked(point0.x, point0.y, point1.x, negativePoint1Y);\n (bool success, bytes memory result) = address(0x06).staticcall(input);\n require(success, \"ecAdd failed\");\n\n (uint256 x, uint256 y) = abi.decode(result, (uint256, uint256));\n return Honk.G1Point({x: x, y: y});\n}\n\nfunction negateInplace(Honk.G1Point memory point) pure returns (Honk.G1Point memory) {\n point.y = (Q - point.y) % Q;\n return point;\n}\n\n\nlibrary RelationsLib {\n Fr internal constant GRUMPKIN_CURVE_B_PARAMETER_NEGATED = Fr.wrap(17); // -(-17)\n\n function accumulateRelationEvaluations(Honk.Proof memory proof, Transcript memory tp, Fr powPartialEval)\n internal\n pure\n returns (Fr accumulator)\n {\n Fr[NUMBER_OF_ENTITIES] memory purportedEvaluations = proof.sumcheckEvaluations;\n Fr[NUMBER_OF_SUBRELATIONS] memory evaluations;\n\n // Accumulate all relations in Ultra Honk - each with varying number of subrelations\n accumulateArithmeticRelation(purportedEvaluations, evaluations, powPartialEval);\n accumulatePermutationRelation(purportedEvaluations, tp, evaluations, powPartialEval);\n accumulateLogDerivativeLookupRelation(purportedEvaluations, tp, evaluations, powPartialEval);\n accumulateDeltaRangeRelation(purportedEvaluations, evaluations, powPartialEval);\n accumulateEllipticRelation(purportedEvaluations, evaluations, powPartialEval);\n accumulateAuxillaryRelation(purportedEvaluations, tp, evaluations, powPartialEval);\n accumulatePoseidonExternalRelation(purportedEvaluations, evaluations, powPartialEval);\n accumulatePoseidonInternalRelation(purportedEvaluations, evaluations, powPartialEval);\n // batch the subrelations with the alpha challenges to obtain the full honk relation\n accumulator = scaleAndBatchSubrelations(evaluations, tp.alphas);\n }\n\n /**\n * Aesthetic helper function that is used to index by enum into proof.sumcheckEvaluations, it avoids\n * the relation checking code being cluttered with uint256 type casting, which is often a different colour in code\n * editors, and thus is noisy.\n */\n function wire(Fr[NUMBER_OF_ENTITIES] memory p, WIRE _wire) internal pure returns (Fr) {\n return p[uint256(_wire)];\n }\n\n uint256 internal constant NEG_HALF_MODULO_P = 0x183227397098d014dc2822db40c0ac2e9419f4243cdcb848a1f0fac9f8000000;\n /**\n * Ultra Arithmetic Relation\n *\n */\n function accumulateArithmeticRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n // Relation 0\n Fr q_arith = wire(p, WIRE.Q_ARITH);\n {\n Fr neg_half = Fr.wrap(NEG_HALF_MODULO_P);\n\n Fr accum = (q_arith - Fr.wrap(3)) * (wire(p, WIRE.Q_M) * wire(p, WIRE.W_R) * wire(p, WIRE.W_L)) * neg_half;\n accum = accum + (wire(p, WIRE.Q_L) * wire(p, WIRE.W_L)) + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_R))\n + (wire(p, WIRE.Q_O) * wire(p, WIRE.W_O)) + (wire(p, WIRE.Q_4) * wire(p, WIRE.W_4)) + wire(p, WIRE.Q_C);\n accum = accum + (q_arith - Fr.wrap(1)) * wire(p, WIRE.W_4_SHIFT);\n accum = accum * q_arith;\n accum = accum * domainSep;\n evals[0] = accum;\n }\n\n // Relation 1\n {\n Fr accum = wire(p, WIRE.W_L) + wire(p, WIRE.W_4) - wire(p, WIRE.W_L_SHIFT) + wire(p, WIRE.Q_M);\n accum = accum * (q_arith - Fr.wrap(2));\n accum = accum * (q_arith - Fr.wrap(1));\n accum = accum * q_arith;\n accum = accum * domainSep;\n evals[1] = accum;\n }\n }\n\n function accumulatePermutationRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Transcript memory tp,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n Fr grand_product_numerator;\n Fr grand_product_denominator;\n\n {\n Fr num = wire(p, WIRE.W_L) + wire(p, WIRE.ID_1) * tp.beta + tp.gamma;\n num = num * (wire(p, WIRE.W_R) + wire(p, WIRE.ID_2) * tp.beta + tp.gamma);\n num = num * (wire(p, WIRE.W_O) + wire(p, WIRE.ID_3) * tp.beta + tp.gamma);\n num = num * (wire(p, WIRE.W_4) + wire(p, WIRE.ID_4) * tp.beta + tp.gamma);\n\n grand_product_numerator = num;\n }\n {\n Fr den = wire(p, WIRE.W_L) + wire(p, WIRE.SIGMA_1) * tp.beta + tp.gamma;\n den = den * (wire(p, WIRE.W_R) + wire(p, WIRE.SIGMA_2) * tp.beta + tp.gamma);\n den = den * (wire(p, WIRE.W_O) + wire(p, WIRE.SIGMA_3) * tp.beta + tp.gamma);\n den = den * (wire(p, WIRE.W_4) + wire(p, WIRE.SIGMA_4) * tp.beta + tp.gamma);\n\n grand_product_denominator = den;\n }\n\n // Contribution 2\n {\n Fr acc = (wire(p, WIRE.Z_PERM) + wire(p, WIRE.LAGRANGE_FIRST)) * grand_product_numerator;\n\n acc = acc\n - (\n (wire(p, WIRE.Z_PERM_SHIFT) + (wire(p, WIRE.LAGRANGE_LAST) * tp.publicInputsDelta))\n * grand_product_denominator\n );\n acc = acc * domainSep;\n evals[2] = acc;\n }\n\n // Contribution 3\n {\n Fr acc = (wire(p, WIRE.LAGRANGE_LAST) * wire(p, WIRE.Z_PERM_SHIFT)) * domainSep;\n evals[3] = acc;\n }\n }\n\n function accumulateLogDerivativeLookupRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Transcript memory tp,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n Fr write_term;\n Fr read_term;\n\n // Calculate the write term (the table accumulation)\n {\n write_term = wire(p, WIRE.TABLE_1) + tp.gamma + (wire(p, WIRE.TABLE_2) * tp.eta)\n + (wire(p, WIRE.TABLE_3) * tp.etaTwo) + (wire(p, WIRE.TABLE_4) * tp.etaThree);\n }\n\n // Calculate the write term\n {\n Fr derived_entry_1 = wire(p, WIRE.W_L) + tp.gamma + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_L_SHIFT));\n Fr derived_entry_2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_M) * wire(p, WIRE.W_R_SHIFT);\n Fr derived_entry_3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_C) * wire(p, WIRE.W_O_SHIFT);\n\n read_term = derived_entry_1 + (derived_entry_2 * tp.eta) + (derived_entry_3 * tp.etaTwo)\n + (wire(p, WIRE.Q_O) * tp.etaThree);\n }\n\n Fr read_inverse = wire(p, WIRE.LOOKUP_INVERSES) * write_term;\n Fr write_inverse = wire(p, WIRE.LOOKUP_INVERSES) * read_term;\n\n Fr inverse_exists_xor = wire(p, WIRE.LOOKUP_READ_TAGS) + wire(p, WIRE.Q_LOOKUP)\n - (wire(p, WIRE.LOOKUP_READ_TAGS) * wire(p, WIRE.Q_LOOKUP));\n\n // Inverse calculated correctly relation\n Fr accumulatorNone = read_term * write_term * wire(p, WIRE.LOOKUP_INVERSES) - inverse_exists_xor;\n accumulatorNone = accumulatorNone * domainSep;\n\n // Inverse\n Fr accumulatorOne = wire(p, WIRE.Q_LOOKUP) * read_inverse - wire(p, WIRE.LOOKUP_READ_COUNTS) * write_inverse;\n\n evals[4] = accumulatorNone;\n evals[5] = accumulatorOne;\n }\n\n function accumulateDeltaRangeRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n Fr minus_one = Fr.wrap(0) - Fr.wrap(1);\n Fr minus_two = Fr.wrap(0) - Fr.wrap(2);\n Fr minus_three = Fr.wrap(0) - Fr.wrap(3);\n\n // Compute wire differences\n Fr delta_1 = wire(p, WIRE.W_R) - wire(p, WIRE.W_L);\n Fr delta_2 = wire(p, WIRE.W_O) - wire(p, WIRE.W_R);\n Fr delta_3 = wire(p, WIRE.W_4) - wire(p, WIRE.W_O);\n Fr delta_4 = wire(p, WIRE.W_L_SHIFT) - wire(p, WIRE.W_4);\n\n // Contribution 6\n {\n Fr acc = delta_1;\n acc = acc * (delta_1 + minus_one);\n acc = acc * (delta_1 + minus_two);\n acc = acc * (delta_1 + minus_three);\n acc = acc * wire(p, WIRE.Q_RANGE);\n acc = acc * domainSep;\n evals[6] = acc;\n }\n\n // Contribution 7\n {\n Fr acc = delta_2;\n acc = acc * (delta_2 + minus_one);\n acc = acc * (delta_2 + minus_two);\n acc = acc * (delta_2 + minus_three);\n acc = acc * wire(p, WIRE.Q_RANGE);\n acc = acc * domainSep;\n evals[7] = acc;\n }\n\n // Contribution 8\n {\n Fr acc = delta_3;\n acc = acc * (delta_3 + minus_one);\n acc = acc * (delta_3 + minus_two);\n acc = acc * (delta_3 + minus_three);\n acc = acc * wire(p, WIRE.Q_RANGE);\n acc = acc * domainSep;\n evals[8] = acc;\n }\n\n // Contribution 9\n {\n Fr acc = delta_4;\n acc = acc * (delta_4 + minus_one);\n acc = acc * (delta_4 + minus_two);\n acc = acc * (delta_4 + minus_three);\n acc = acc * wire(p, WIRE.Q_RANGE);\n acc = acc * domainSep;\n evals[9] = acc;\n }\n }\n\n struct EllipticParams {\n // Points\n Fr x_1;\n Fr y_1;\n Fr x_2;\n Fr y_2;\n Fr y_3;\n Fr x_3;\n // push accumulators into memory\n Fr x_double_identity;\n }\n\n function accumulateEllipticRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n EllipticParams memory ep;\n ep.x_1 = wire(p, WIRE.W_R);\n ep.y_1 = wire(p, WIRE.W_O);\n\n ep.x_2 = wire(p, WIRE.W_L_SHIFT);\n ep.y_2 = wire(p, WIRE.W_4_SHIFT);\n ep.y_3 = wire(p, WIRE.W_O_SHIFT);\n ep.x_3 = wire(p, WIRE.W_R_SHIFT);\n\n Fr q_sign = wire(p, WIRE.Q_L);\n Fr q_is_double = wire(p, WIRE.Q_M);\n\n // Contribution 10 point addition, x-coordinate check\n // q_elliptic * (x3 + x2 + x1)(x2 - x1)(x2 - x1) - y2^2 - y1^2 + 2(y2y1)*q_sign = 0\n Fr x_diff = (ep.x_2 - ep.x_1);\n Fr y1_sqr = (ep.y_1 * ep.y_1);\n {\n // Move to top\n Fr partialEval = domainSep;\n\n Fr y2_sqr = (ep.y_2 * ep.y_2);\n Fr y1y2 = ep.y_1 * ep.y_2 * q_sign;\n Fr x_add_identity = (ep.x_3 + ep.x_2 + ep.x_1);\n x_add_identity = x_add_identity * x_diff * x_diff;\n x_add_identity = x_add_identity - y2_sqr - y1_sqr + y1y2 + y1y2;\n\n evals[10] = x_add_identity * partialEval * wire(p, WIRE.Q_ELLIPTIC) * (Fr.wrap(1) - q_is_double);\n }\n\n // Contribution 11 point addition, x-coordinate check\n // q_elliptic * (q_sign * y1 + y3)(x2 - x1) + (x3 - x1)(y2 - q_sign * y1) = 0\n {\n Fr y1_plus_y3 = ep.y_1 + ep.y_3;\n Fr y_diff = ep.y_2 * q_sign - ep.y_1;\n Fr y_add_identity = y1_plus_y3 * x_diff + (ep.x_3 - ep.x_1) * y_diff;\n evals[11] = y_add_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * (Fr.wrap(1) - q_is_double);\n }\n\n // Contribution 10 point doubling, x-coordinate check\n // (x3 + x1 + x1) (4y1*y1) - 9 * x1 * x1 * x1 * x1 = 0\n // N.B. we're using the equivalence x1*x1*x1 === y1*y1 - curve_b to reduce degree by 1\n {\n Fr x_pow_4 = (y1_sqr + GRUMPKIN_CURVE_B_PARAMETER_NEGATED) * ep.x_1;\n Fr y1_sqr_mul_4 = y1_sqr + y1_sqr;\n y1_sqr_mul_4 = y1_sqr_mul_4 + y1_sqr_mul_4;\n Fr x1_pow_4_mul_9 = x_pow_4 * Fr.wrap(9);\n\n // NOTE: pushed into memory (stack >:'( )\n ep.x_double_identity = (ep.x_3 + ep.x_1 + ep.x_1) * y1_sqr_mul_4 - x1_pow_4_mul_9;\n\n Fr acc = ep.x_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;\n evals[10] = evals[10] + acc;\n }\n\n // Contribution 11 point doubling, y-coordinate check\n // (y1 + y1) (2y1) - (3 * x1 * x1)(x1 - x3) = 0\n {\n Fr x1_sqr_mul_3 = (ep.x_1 + ep.x_1 + ep.x_1) * ep.x_1;\n Fr y_double_identity = x1_sqr_mul_3 * (ep.x_1 - ep.x_3) - (ep.y_1 + ep.y_1) * (ep.y_1 + ep.y_3);\n evals[11] = evals[11] + y_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;\n }\n }\n\n // Constants for the auxiliary relation\n Fr constant LIMB_SIZE = Fr.wrap(uint256(1) << 68);\n Fr constant SUBLIMB_SHIFT = Fr.wrap(uint256(1) << 14);\n\n // Parameters used within the Auxiliary Relation\n // A struct is used to work around stack too deep. This relation has alot of variables\n struct AuxParams {\n Fr limb_subproduct;\n Fr non_native_field_gate_1;\n Fr non_native_field_gate_2;\n Fr non_native_field_gate_3;\n Fr limb_accumulator_1;\n Fr limb_accumulator_2;\n Fr memory_record_check;\n Fr partial_record_check;\n Fr next_gate_access_type;\n Fr record_delta;\n Fr index_delta;\n Fr adjacent_values_match_if_adjacent_indices_match;\n Fr adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation;\n Fr access_check;\n Fr next_gate_access_type_is_boolean;\n Fr ROM_consistency_check_identity;\n Fr RAM_consistency_check_identity;\n Fr timestamp_delta;\n Fr RAM_timestamp_check_identity;\n Fr memory_identity;\n Fr index_is_monotonically_increasing;\n Fr auxiliary_identity;\n }\n\n function accumulateAuxillaryRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Transcript memory tp,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n AuxParams memory ap;\n\n /**\n * Contribution 12\n * Non native field arithmetic gate 2\n * deg 4\n *\n * _ _\n * / _ _ _ 14 \\\n * q_2 . q_4 | (w_1 . w_2) + (w_1 . w_2) + (w_1 . w_4 + w_2 . w_3 - w_3) . 2 - w_3 - w_4 |\n * \\_ _/\n *\n *\n */\n ap.limb_subproduct = wire(p, WIRE.W_L) * wire(p, WIRE.W_R_SHIFT) + wire(p, WIRE.W_L_SHIFT) * wire(p, WIRE.W_R);\n ap.non_native_field_gate_2 =\n (wire(p, WIRE.W_L) * wire(p, WIRE.W_4) + wire(p, WIRE.W_R) * wire(p, WIRE.W_O) - wire(p, WIRE.W_O_SHIFT));\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 * LIMB_SIZE;\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 - wire(p, WIRE.W_4_SHIFT);\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 + ap.limb_subproduct;\n ap.non_native_field_gate_2 = ap.non_native_field_gate_2 * wire(p, WIRE.Q_4);\n\n ap.limb_subproduct = ap.limb_subproduct * LIMB_SIZE;\n ap.limb_subproduct = ap.limb_subproduct + (wire(p, WIRE.W_L_SHIFT) * wire(p, WIRE.W_R_SHIFT));\n ap.non_native_field_gate_1 = ap.limb_subproduct;\n ap.non_native_field_gate_1 = ap.non_native_field_gate_1 - (wire(p, WIRE.W_O) + wire(p, WIRE.W_4));\n ap.non_native_field_gate_1 = ap.non_native_field_gate_1 * wire(p, WIRE.Q_O);\n\n ap.non_native_field_gate_3 = ap.limb_subproduct;\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 + wire(p, WIRE.W_4);\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 - (wire(p, WIRE.W_O_SHIFT) + wire(p, WIRE.W_4_SHIFT));\n ap.non_native_field_gate_3 = ap.non_native_field_gate_3 * wire(p, WIRE.Q_M);\n\n Fr non_native_field_identity =\n ap.non_native_field_gate_1 + ap.non_native_field_gate_2 + ap.non_native_field_gate_3;\n non_native_field_identity = non_native_field_identity * wire(p, WIRE.Q_R);\n\n // ((((w2' * 2^14 + w1') * 2^14 + w3) * 2^14 + w2) * 2^14 + w1 - w4) * qm\n // deg 2\n ap.limb_accumulator_1 = wire(p, WIRE.W_R_SHIFT) * SUBLIMB_SHIFT;\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_L_SHIFT);\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_O);\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_R);\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * SUBLIMB_SHIFT;\n ap.limb_accumulator_1 = ap.limb_accumulator_1 + wire(p, WIRE.W_L);\n ap.limb_accumulator_1 = ap.limb_accumulator_1 - wire(p, WIRE.W_4);\n ap.limb_accumulator_1 = ap.limb_accumulator_1 * wire(p, WIRE.Q_4);\n\n // ((((w3' * 2^14 + w2') * 2^14 + w1') * 2^14 + w4) * 2^14 + w3 - w4') * qm\n // deg 2\n ap.limb_accumulator_2 = wire(p, WIRE.W_O_SHIFT) * SUBLIMB_SHIFT;\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_R_SHIFT);\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_L_SHIFT);\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_4);\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * SUBLIMB_SHIFT;\n ap.limb_accumulator_2 = ap.limb_accumulator_2 + wire(p, WIRE.W_O);\n ap.limb_accumulator_2 = ap.limb_accumulator_2 - wire(p, WIRE.W_4_SHIFT);\n ap.limb_accumulator_2 = ap.limb_accumulator_2 * wire(p, WIRE.Q_M);\n\n Fr limb_accumulator_identity = ap.limb_accumulator_1 + ap.limb_accumulator_2;\n limb_accumulator_identity = limb_accumulator_identity * wire(p, WIRE.Q_O); // deg 3\n\n /**\n * MEMORY\n *\n * A RAM memory record contains a tuple of the following fields:\n * * i: `index` of memory cell being accessed\n * * t: `timestamp` of memory cell being accessed (used for RAM, set to 0 for ROM)\n * * v: `value` of memory cell being accessed\n * * a: `access` type of record. read: 0 = read, 1 = write\n * * r: `record` of memory cell. record = access + index * eta + timestamp * eta_two + value * eta_three\n *\n * A ROM memory record contains a tuple of the following fields:\n * * i: `index` of memory cell being accessed\n * * v: `value1` of memory cell being accessed (ROM tables can store up to 2 values per index)\n * * v2:`value2` of memory cell being accessed (ROM tables can store up to 2 values per index)\n * * r: `record` of memory cell. record = index * eta + value2 * eta_two + value1 * eta_three\n *\n * When performing a read/write access, the values of i, t, v, v2, a, r are stored in the following wires +\n * selectors, depending on whether the gate is a RAM read/write or a ROM read\n *\n * | gate type | i | v2/t | v | a | r |\n * | --------- | -- | ----- | -- | -- | -- |\n * | ROM | w1 | w2 | w3 | -- | w4 |\n * | RAM | w1 | w2 | w3 | qc | w4 |\n *\n * (for accesses where `index` is a circuit constant, it is assumed the circuit will apply a copy constraint on\n * `w2` to fix its value)\n *\n *\n */\n\n /**\n * Memory Record Check\n * Partial degree: 1\n * Total degree: 4\n *\n * A ROM/ROM access gate can be evaluated with the identity:\n *\n * qc + w1 \\eta + w2 \\eta_two + w3 \\eta_three - w4 = 0\n *\n * For ROM gates, qc = 0\n */\n ap.memory_record_check = wire(p, WIRE.W_O) * tp.etaThree;\n ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_R) * tp.etaTwo);\n ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_L) * tp.eta);\n ap.memory_record_check = ap.memory_record_check + wire(p, WIRE.Q_C);\n ap.partial_record_check = ap.memory_record_check; // used in RAM consistency check; deg 1 or 4\n ap.memory_record_check = ap.memory_record_check - wire(p, WIRE.W_4);\n\n /**\n * Contribution 13 & 14\n * ROM Consistency Check\n * Partial degree: 1\n * Total degree: 4\n *\n * For every ROM read, a set equivalence check is applied between the record witnesses, and a second set of\n * records that are sorted.\n *\n * We apply the following checks for the sorted records:\n *\n * 1. w1, w2, w3 correctly map to 'index', 'v1, 'v2' for a given record value at w4\n * 2. index values for adjacent records are monotonically increasing\n * 3. if, at gate i, index_i == index_{i + 1}, then value1_i == value1_{i + 1} and value2_i == value2_{i + 1}\n *\n */\n ap.index_delta = wire(p, WIRE.W_L_SHIFT) - wire(p, WIRE.W_L);\n ap.record_delta = wire(p, WIRE.W_4_SHIFT) - wire(p, WIRE.W_4);\n\n ap.index_is_monotonically_increasing = ap.index_delta * ap.index_delta - ap.index_delta; // deg 2\n\n ap.adjacent_values_match_if_adjacent_indices_match = (ap.index_delta * MINUS_ONE + Fr.wrap(1)) * ap.record_delta; // deg 2\n\n evals[13] = ap.adjacent_values_match_if_adjacent_indices_match * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))\n * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5\n evals[14] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))\n * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5\n\n ap.ROM_consistency_check_identity = ap.memory_record_check * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R)); // deg 3 or 7\n\n /**\n * Contributions 15,16,17\n * RAM Consistency Check\n *\n * The 'access' type of the record is extracted with the expression `w_4 - ap.partial_record_check`\n * (i.e. for an honest Prover `w1 * eta + w2 * eta^2 + w3 * eta^3 - w4 = access`.\n * This is validated by requiring `access` to be boolean\n *\n * For two adjacent entries in the sorted list if _both_\n * A) index values match\n * B) adjacent access value is 0 (i.e. next gate is a READ)\n * then\n * C) both values must match.\n * The gate boolean check is\n * (A && B) => C === !(A && B) || C === !A || !B || C\n *\n * N.B. it is the responsibility of the circuit writer to ensure that every RAM cell is initialized\n * with a WRITE operation.\n */\n Fr access_type = (wire(p, WIRE.W_4) - ap.partial_record_check); // will be 0 or 1 for honest Prover; deg 1 or 4\n ap.access_check = access_type * access_type - access_type; // check value is 0 or 1; deg 2 or 8\n\n ap.next_gate_access_type = wire(p, WIRE.W_O_SHIFT) * tp.etaThree;\n ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_R_SHIFT) * tp.etaTwo);\n ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_L_SHIFT) * tp.eta);\n ap.next_gate_access_type = wire(p, WIRE.W_4_SHIFT) - ap.next_gate_access_type;\n\n Fr value_delta = wire(p, WIRE.W_O_SHIFT) - wire(p, WIRE.W_O);\n ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation = (\n ap.index_delta * MINUS_ONE + Fr.wrap(1)\n ) * value_delta * (ap.next_gate_access_type * MINUS_ONE + Fr.wrap(1)); // deg 3 or 6\n\n // We can't apply the RAM consistency check identity on the final entry in the sorted list (the wires in the\n // next gate would make the identity fail). We need to validate that its 'access type' bool is correct. Can't\n // do with an arithmetic gate because of the `eta` factors. We need to check that the *next* gate's access\n // type is correct, to cover this edge case\n // deg 2 or 4\n ap.next_gate_access_type_is_boolean =\n ap.next_gate_access_type * ap.next_gate_access_type - ap.next_gate_access_type;\n\n // Putting it all together...\n evals[15] = ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation\n * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 5 or 8\n evals[16] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4\n evals[17] = ap.next_gate_access_type_is_boolean * (wire(p, WIRE.Q_ARITH)) * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4 or 6\n\n ap.RAM_consistency_check_identity = ap.access_check * (wire(p, WIRE.Q_ARITH)); // deg 3 or 9\n\n /**\n * RAM Timestamp Consistency Check\n *\n * | w1 | w2 | w3 | w4 |\n * | index | timestamp | timestamp_check | -- |\n *\n * Let delta_index = index_{i + 1} - index_{i}\n *\n * Iff delta_index == 0, timestamp_check = timestamp_{i + 1} - timestamp_i\n * Else timestamp_check = 0\n */\n ap.timestamp_delta = wire(p, WIRE.W_R_SHIFT) - wire(p, WIRE.W_R);\n ap.RAM_timestamp_check_identity =\n (ap.index_delta * MINUS_ONE + Fr.wrap(1)) * ap.timestamp_delta - wire(p, WIRE.W_O); // deg 3\n\n /**\n * Complete Contribution 12\n * The complete RAM/ROM memory identity\n * Partial degree:\n */\n ap.memory_identity = ap.ROM_consistency_check_identity; // deg 3 or 6\n ap.memory_identity =\n ap.memory_identity + ap.RAM_timestamp_check_identity * (wire(p, WIRE.Q_4) * wire(p, WIRE.Q_L)); // deg 4\n ap.memory_identity = ap.memory_identity + ap.memory_record_check * (wire(p, WIRE.Q_M) * wire(p, WIRE.Q_L)); // deg 3 or 6\n ap.memory_identity = ap.memory_identity + ap.RAM_consistency_check_identity; // deg 3 or 9\n\n // (deg 3 or 9) + (deg 4) + (deg 3)\n ap.auxiliary_identity = ap.memory_identity + non_native_field_identity + limb_accumulator_identity;\n ap.auxiliary_identity = ap.auxiliary_identity * (wire(p, WIRE.Q_AUX) * domainSep); // deg 4 or 10\n evals[12] = ap.auxiliary_identity;\n }\n\n struct PoseidonExternalParams {\n Fr s1;\n Fr s2;\n Fr s3;\n Fr s4;\n Fr u1;\n Fr u2;\n Fr u3;\n Fr u4;\n Fr t0;\n Fr t1;\n Fr t2;\n Fr t3;\n Fr v1;\n Fr v2;\n Fr v3;\n Fr v4;\n Fr q_pos_by_scaling;\n }\n\n function accumulatePoseidonExternalRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n PoseidonExternalParams memory ep;\n\n ep.s1 = wire(p, WIRE.W_L) + wire(p, WIRE.Q_L);\n ep.s2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_R);\n ep.s3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_O);\n ep.s4 = wire(p, WIRE.W_4) + wire(p, WIRE.Q_4);\n\n ep.u1 = ep.s1 * ep.s1 * ep.s1 * ep.s1 * ep.s1;\n ep.u2 = ep.s2 * ep.s2 * ep.s2 * ep.s2 * ep.s2;\n ep.u3 = ep.s3 * ep.s3 * ep.s3 * ep.s3 * ep.s3;\n ep.u4 = ep.s4 * ep.s4 * ep.s4 * ep.s4 * ep.s4;\n // matrix mul v = M_E * u with 14 additions\n ep.t0 = ep.u1 + ep.u2; // u_1 + u_2\n ep.t1 = ep.u3 + ep.u4; // u_3 + u_4\n ep.t2 = ep.u2 + ep.u2 + ep.t1; // 2u_2\n // ep.t2 += ep.t1; // 2u_2 + u_3 + u_4\n ep.t3 = ep.u4 + ep.u4 + ep.t0; // 2u_4\n // ep.t3 += ep.t0; // u_1 + u_2 + 2u_4\n ep.v4 = ep.t1 + ep.t1;\n ep.v4 = ep.v4 + ep.v4 + ep.t3;\n // ep.v4 += ep.t3; // u_1 + u_2 + 4u_3 + 6u_4\n ep.v2 = ep.t0 + ep.t0;\n ep.v2 = ep.v2 + ep.v2 + ep.t2;\n // ep.v2 += ep.t2; // 4u_1 + 6u_2 + u_3 + u_4\n ep.v1 = ep.t3 + ep.v2; // 5u_1 + 7u_2 + u_3 + 3u_4\n ep.v3 = ep.t2 + ep.v4; // u_1 + 3u_2 + 5u_3 + 7u_4\n\n ep.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_EXTERNAL) * domainSep;\n evals[18] = evals[18] + ep.q_pos_by_scaling * (ep.v1 - wire(p, WIRE.W_L_SHIFT));\n\n evals[19] = evals[19] + ep.q_pos_by_scaling * (ep.v2 - wire(p, WIRE.W_R_SHIFT));\n\n evals[20] = evals[20] + ep.q_pos_by_scaling * (ep.v3 - wire(p, WIRE.W_O_SHIFT));\n\n evals[21] = evals[21] + ep.q_pos_by_scaling * (ep.v4 - wire(p, WIRE.W_4_SHIFT));\n }\n\n struct PoseidonInternalParams {\n Fr u1;\n Fr u2;\n Fr u3;\n Fr u4;\n Fr u_sum;\n Fr v1;\n Fr v2;\n Fr v3;\n Fr v4;\n Fr s1;\n Fr q_pos_by_scaling;\n }\n\n function accumulatePoseidonInternalRelation(\n Fr[NUMBER_OF_ENTITIES] memory p,\n Fr[NUMBER_OF_SUBRELATIONS] memory evals,\n Fr domainSep\n ) internal pure {\n PoseidonInternalParams memory ip;\n\n Fr[4] memory INTERNAL_MATRIX_DIAGONAL = [\n FrLib.from(0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e7),\n FrLib.from(0x0c28145b6a44df3e0149b3d0a30b3bb599df9756d4dd9b84a86b38cfb45a740b),\n FrLib.from(0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac15),\n FrLib.from(0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428b)\n ];\n\n // add round constants\n ip.s1 = wire(p, WIRE.W_L) + wire(p, WIRE.Q_L);\n\n // apply s-box round\n ip.u1 = ip.s1 * ip.s1 * ip.s1 * ip.s1 * ip.s1;\n ip.u2 = wire(p, WIRE.W_R);\n ip.u3 = wire(p, WIRE.W_O);\n ip.u4 = wire(p, WIRE.W_4);\n\n // matrix mul with v = M_I * u 4 muls and 7 additions\n ip.u_sum = ip.u1 + ip.u2 + ip.u3 + ip.u4;\n\n ip.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_INTERNAL) * domainSep;\n\n ip.v1 = ip.u1 * INTERNAL_MATRIX_DIAGONAL[0] + ip.u_sum;\n evals[22] = evals[22] + ip.q_pos_by_scaling * (ip.v1 - wire(p, WIRE.W_L_SHIFT));\n\n ip.v2 = ip.u2 * INTERNAL_MATRIX_DIAGONAL[1] + ip.u_sum;\n evals[23] = evals[23] + ip.q_pos_by_scaling * (ip.v2 - wire(p, WIRE.W_R_SHIFT));\n\n ip.v3 = ip.u3 * INTERNAL_MATRIX_DIAGONAL[2] + ip.u_sum;\n evals[24] = evals[24] + ip.q_pos_by_scaling * (ip.v3 - wire(p, WIRE.W_O_SHIFT));\n\n ip.v4 = ip.u4 * INTERNAL_MATRIX_DIAGONAL[3] + ip.u_sum;\n evals[25] = evals[25] + ip.q_pos_by_scaling * (ip.v4 - wire(p, WIRE.W_4_SHIFT));\n }\n\n function scaleAndBatchSubrelations(\n Fr[NUMBER_OF_SUBRELATIONS] memory evaluations,\n Fr[NUMBER_OF_ALPHAS] memory subrelationChallenges\n ) internal pure returns (Fr accumulator) {\n accumulator = accumulator + evaluations[0];\n\n for (uint256 i = 1; i < NUMBER_OF_SUBRELATIONS; ++i) {\n accumulator = accumulator + evaluations[i] * subrelationChallenges[i - 1];\n }\n }\n}\n\n// Errors\nerror PublicInputsLengthWrong();\nerror SumcheckFailed();\nerror ShpleminiFailed();\n\ninterface IVerifier {\n function verify(bytes calldata _proof, bytes32[] calldata _publicInputs) external view returns (bool);\n}\n\n// Smart contract verifier of honk proofs\ncontract HonkVerifier is IVerifier\n{\n using FrLib for Fr;\n\n function verify(bytes calldata proof, bytes32[] calldata publicInputs) public view override returns (bool) {\n Honk.VerificationKey memory vk = loadVerificationKey();\n Honk.Proof memory p = TranscriptLib.loadProof(proof);\n\n if (publicInputs.length != vk.publicInputsSize) {\n revert PublicInputsLengthWrong();\n }\n\n // Generate the fiat shamir challenges for the whole protocol\n Transcript memory t = TranscriptLib.generateTranscript(p, publicInputs, vk.publicInputsSize);\n\n // Compute the public input delta\n t.publicInputsDelta =\n computePublicInputDelta(publicInputs, t.beta, t.gamma, vk.circuitSize, p.publicInputsOffset);\n\n // Sumcheck\n bool sumcheckVerified = verifySumcheck(p, t);\n if (!sumcheckVerified) revert SumcheckFailed();\n\n bool shpleminiVerified = verifyShplemini(p, vk, t);\n if (!shpleminiVerified) revert ShpleminiFailed();\n\n return sumcheckVerified && shpleminiVerified; // Boolean condition not required - nice for vanity :)\n }\n\n function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) {\n return HonkVerificationKey.loadVerificationKey();\n }\n\n function computePublicInputDelta(\n bytes32[] memory publicInputs,\n Fr beta,\n Fr gamma,\n uint256 domainSize,\n uint256 offset\n ) internal view returns (Fr publicInputDelta) {\n Fr numerator = Fr.wrap(1);\n Fr denominator = Fr.wrap(1);\n\n Fr numeratorAcc = gamma + (beta * FrLib.from(domainSize + offset));\n Fr denominatorAcc = gamma - (beta * FrLib.from(offset + 1));\n\n {\n for (uint256 i = 0; i < NUMBER_OF_PUBLIC_INPUTS; i++) {\n Fr pubInput = FrLib.fromBytes32(publicInputs[i]);\n\n numerator = numerator * (numeratorAcc + pubInput);\n denominator = denominator * (denominatorAcc + pubInput);\n\n numeratorAcc = numeratorAcc + beta;\n denominatorAcc = denominatorAcc - beta;\n }\n }\n\n // Fr delta = numerator / denominator; // TOOO: batch invert later?\n publicInputDelta = FrLib.div(numerator, denominator);\n }\n\n uint256 constant ROUND_TARGET = 0;\n\n function verifySumcheck(Honk.Proof memory proof, Transcript memory tp) internal view returns (bool verified) {\n Fr roundTarget;\n Fr powPartialEvaluation = Fr.wrap(1);\n\n // We perform sumcheck reductions over log n rounds ( the multivariate degree )\n for (uint256 round; round < LOG_N; ++round) {\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariate = proof.sumcheckUnivariates[round];\n bool valid = checkSum(roundUnivariate, roundTarget);\n if (!valid) revert SumcheckFailed();\n\n Fr roundChallenge = tp.sumCheckUChallenges[round];\n\n // Update the round target for the next rounf\n roundTarget = computeNextTargetSum(roundUnivariate, roundChallenge);\n powPartialEvaluation = partiallyEvaluatePOW(tp, powPartialEvaluation, roundChallenge, round);\n }\n\n // Last round\n Fr grandHonkRelationSum = RelationsLib.accumulateRelationEvaluations(proof, tp, powPartialEvaluation);\n verified = (grandHonkRelationSum == roundTarget);\n }\n\n function checkSum(Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariate, Fr roundTarget)\n internal\n pure\n returns (bool checked)\n {\n Fr totalSum = roundUnivariate[0] + roundUnivariate[1];\n checked = totalSum == roundTarget;\n }\n\n // Return the new target sum for the next sumcheck round\n function computeNextTargetSum(Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory roundUnivariates, Fr roundChallenge)\n internal\n view\n returns (Fr targetSum)\n {\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory BARYCENTRIC_LAGRANGE_DENOMINATORS = [\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffec51),\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000002d0),\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff11),\n Fr.wrap(0x0000000000000000000000000000000000000000000000000000000000000090),\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593efffff71),\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000000f0),\n Fr.wrap(0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593effffd31),\n Fr.wrap(0x00000000000000000000000000000000000000000000000000000000000013b0)\n ];\n\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory BARYCENTRIC_DOMAIN = [\n Fr.wrap(0x00),\n Fr.wrap(0x01),\n Fr.wrap(0x02),\n Fr.wrap(0x03),\n Fr.wrap(0x04),\n Fr.wrap(0x05),\n Fr.wrap(0x06),\n Fr.wrap(0x07)\n ];\n // To compute the next target sum, we evaluate the given univariate at a point u (challenge).\n\n // Performing Barycentric evaluations\n // Compute B(x)\n Fr numeratorValue = Fr.wrap(1);\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\n numeratorValue = numeratorValue * (roundChallenge - Fr.wrap(i));\n }\n\n // Calculate domain size N of inverses\n Fr[BATCHED_RELATION_PARTIAL_LENGTH] memory denominatorInverses;\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\n Fr inv = BARYCENTRIC_LAGRANGE_DENOMINATORS[i];\n inv = inv * (roundChallenge - BARYCENTRIC_DOMAIN[i]);\n inv = FrLib.invert(inv);\n denominatorInverses[i] = inv;\n }\n\n for (uint256 i; i < BATCHED_RELATION_PARTIAL_LENGTH; ++i) {\n Fr term = roundUnivariates[i];\n term = term * denominatorInverses[i];\n targetSum = targetSum + term;\n }\n\n // Scale the sum by the value of B(x)\n targetSum = targetSum * numeratorValue;\n }\n\n // Univariate evaluation of the monomial ((1-X_l) + X_l.B_l) at the challenge point X_l=u_l\n function partiallyEvaluatePOW(Transcript memory tp, Fr currentEvaluation, Fr roundChallenge, uint256 round)\n internal\n pure\n returns (Fr newEvaluation)\n {\n Fr univariateEval = Fr.wrap(1) + (roundChallenge * (tp.gateChallenges[round] - Fr.wrap(1)));\n newEvaluation = currentEvaluation * univariateEval;\n }\n\n // Avoid stack too deep\n struct ShpleminiIntermediates {\n // i-th unshifted commitment is multiplied by −ρⁱ and the unshifted_scalar ( 1/(z−r) + ν/(z+r) )\n Fr unshiftedScalar;\n // i-th shifted commitment is multiplied by −ρⁱ⁺ᵏ and the shifted_scalar r⁻¹ ⋅ (1/(z−r) − ν/(z+r))\n Fr shiftedScalar;\n // Scalar to be multiplied by [1]₁\n Fr constantTermAccumulator;\n // Accumulator for powers of rho\n Fr batchingChallenge;\n // Linear combination of multilinear (sumcheck) evaluations and powers of rho\n Fr batchedEvaluation;\n }\n\n function verifyShplemini(Honk.Proof memory proof, Honk.VerificationKey memory vk, Transcript memory tp)\n internal\n view\n returns (bool verified)\n {\n ShpleminiIntermediates memory mem; // stack\n\n // - Compute vector (r, r², ... , r²⁽ⁿ⁻¹⁾), where n = log_circuit_size, I think this should be CONST_PROOF_SIZE\n Fr[CONST_PROOF_SIZE_LOG_N] memory powers_of_evaluation_challenge = computeSquares(tp.geminiR);\n\n // Arrays hold values that will be linearly combined for the gemini and shplonk batch openings\n Fr[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory scalars;\n Honk.G1Point[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory commitments;\n\n Fr[CONST_PROOF_SIZE_LOG_N + 1] memory inverse_vanishing_evals =\n computeInvertedGeminiDenominators(tp, powers_of_evaluation_challenge);\n\n mem.unshiftedScalar = inverse_vanishing_evals[0] + (tp.shplonkNu * inverse_vanishing_evals[1]);\n mem.shiftedScalar =\n tp.geminiR.invert() * (inverse_vanishing_evals[0] - (tp.shplonkNu * inverse_vanishing_evals[1]));\n\n scalars[0] = Fr.wrap(1);\n commitments[0] = convertProofPoint(proof.shplonkQ);\n\n /* Batch multivariate opening claims, shifted and unshifted\n * The vector of scalars is populated as follows:\n * \\f[\n * \\left(\n * - \\left(\\frac{1}{z-r} + \\nu \\times \\frac{1}{z+r}\\right),\n * \\ldots,\n * - \\rho^{i+k-1} \\times \\left(\\frac{1}{z-r} + \\nu \\times \\frac{1}{z+r}\\right),\n * - \\rho^{i+k} \\times \\frac{1}{r} \\times \\left(\\frac{1}{z-r} - \\nu \\times \\frac{1}{z+r}\\right),\n * \\ldots,\n * - \\rho^{k+m-1} \\times \\frac{1}{r} \\times \\left(\\frac{1}{z-r} - \\nu \\times \\frac{1}{z+r}\\right)\n * \\right)\n * \\f]\n *\n * The following vector is concatenated to the vector of commitments:\n * \\f[\n * f_0, \\ldots, f_{m-1}, f_{\\text{shift}, 0}, \\ldots, f_{\\text{shift}, k-1}\n * \\f]\n *\n * Simultaneously, the evaluation of the multilinear polynomial\n * \\f[\n * \\sum \\rho^i \\cdot f_i + \\sum \\rho^{i+k} \\cdot f_{\\text{shift}, i}\n * \\f]\n * at the challenge point \\f$ (u_0,\\ldots, u_{n-1}) \\f$ is computed.\n *\n * This approach minimizes the number of iterations over the commitments to multilinear polynomials\n * and eliminates the need to store the powers of \\f$ \\rho \\f$.\n */\n mem.batchingChallenge = Fr.wrap(1);\n mem.batchedEvaluation = Fr.wrap(0);\n\n for (uint256 i = 1; i <= NUMBER_UNSHIFTED; ++i) {\n scalars[i] = mem.unshiftedScalar.neg() * mem.batchingChallenge;\n mem.batchedEvaluation = mem.batchedEvaluation + (proof.sumcheckEvaluations[i - 1] * mem.batchingChallenge);\n mem.batchingChallenge = mem.batchingChallenge * tp.rho;\n }\n // g commitments are accumulated at r\n for (uint256 i = NUMBER_UNSHIFTED + 1; i <= NUMBER_OF_ENTITIES; ++i) {\n scalars[i] = mem.shiftedScalar.neg() * mem.batchingChallenge;\n mem.batchedEvaluation = mem.batchedEvaluation + (proof.sumcheckEvaluations[i - 1] * mem.batchingChallenge);\n mem.batchingChallenge = mem.batchingChallenge * tp.rho;\n }\n\n commitments[1] = vk.qm;\n commitments[2] = vk.qc;\n commitments[3] = vk.ql;\n commitments[4] = vk.qr;\n commitments[5] = vk.qo;\n commitments[6] = vk.q4;\n commitments[7] = vk.qArith;\n commitments[8] = vk.qDeltaRange;\n commitments[9] = vk.qElliptic;\n commitments[10] = vk.qAux;\n commitments[11] = vk.qLookup;\n commitments[12] = vk.qPoseidon2External;\n commitments[13] = vk.qPoseidon2Internal;\n commitments[14] = vk.s1;\n commitments[15] = vk.s2;\n commitments[16] = vk.s3;\n commitments[17] = vk.s4;\n commitments[18] = vk.id1;\n commitments[19] = vk.id2;\n commitments[20] = vk.id3;\n commitments[21] = vk.id4;\n commitments[22] = vk.t1;\n commitments[23] = vk.t2;\n commitments[24] = vk.t3;\n commitments[25] = vk.t4;\n commitments[26] = vk.lagrangeFirst;\n commitments[27] = vk.lagrangeLast;\n\n // Accumulate proof points\n commitments[28] = convertProofPoint(proof.w1);\n commitments[29] = convertProofPoint(proof.w2);\n commitments[30] = convertProofPoint(proof.w3);\n commitments[31] = convertProofPoint(proof.w4);\n commitments[32] = convertProofPoint(proof.zPerm);\n commitments[33] = convertProofPoint(proof.lookupInverses);\n commitments[34] = convertProofPoint(proof.lookupReadCounts);\n commitments[35] = convertProofPoint(proof.lookupReadTags);\n\n // to be Shifted\n commitments[36] = vk.t1;\n commitments[37] = vk.t2;\n commitments[38] = vk.t3;\n commitments[39] = vk.t4;\n commitments[40] = convertProofPoint(proof.w1);\n commitments[41] = convertProofPoint(proof.w2);\n commitments[42] = convertProofPoint(proof.w3);\n commitments[43] = convertProofPoint(proof.w4);\n commitments[44] = convertProofPoint(proof.zPerm);\n\n /* Batch gemini claims from the prover\n * place the commitments to gemini aᵢ to the vector of commitments, compute the contributions from\n * aᵢ(−r²ⁱ) for i=1, … , n−1 to the constant term accumulator, add corresponding scalars\n *\n * 1. Moves the vector\n * \\f[\n * \\left( \\text{com}(A_1), \\text{com}(A_2), \\ldots, \\text{com}(A_{n-1}) \\right)\n * \\f]\n * to the 'commitments' vector.\n *\n * 2. Computes the scalars:\n * \\f[\n * \\frac{\\nu^{2}}{z + r^2}, \\frac{\\nu^3}{z + r^4}, \\ldots, \\frac{\\nu^{n-1}}{z + r^{2^{n-1}}}\n * \\f]\n * and places them into the 'scalars' vector.\n *\n * 3. Accumulates the summands of the constant term:\n * \\f[\n * \\sum_{i=2}^{n-1} \\frac{\\nu^{i} \\cdot A_i(-r^{2^i})}{z + r^{2^i}}\n * \\f]\n * and adds them to the 'constant_term_accumulator'.\n */\n mem.constantTermAccumulator = Fr.wrap(0);\n mem.batchingChallenge = tp.shplonkNu.sqr();\n\n for (uint256 i; i < CONST_PROOF_SIZE_LOG_N - 1; ++i) {\n bool dummy_round = i >= (LOG_N - 1);\n\n Fr scalingFactor = Fr.wrap(0);\n if (!dummy_round) {\n scalingFactor = mem.batchingChallenge * inverse_vanishing_evals[i + 2];\n scalars[NUMBER_OF_ENTITIES + 1 + i] = scalingFactor.neg();\n }\n\n mem.constantTermAccumulator =\n mem.constantTermAccumulator + (scalingFactor * proof.geminiAEvaluations[i + 1]);\n mem.batchingChallenge = mem.batchingChallenge * tp.shplonkNu;\n\n commitments[NUMBER_OF_ENTITIES + 1 + i] = convertProofPoint(proof.geminiFoldComms[i]);\n }\n\n // Add contributions from A₀(r) and A₀(-r) to constant_term_accumulator:\n // Compute evaluation A₀(r)\n Fr a_0_pos = computeGeminiBatchedUnivariateEvaluation(\n tp, mem.batchedEvaluation, proof.geminiAEvaluations, powers_of_evaluation_challenge\n );\n\n mem.constantTermAccumulator = mem.constantTermAccumulator + (a_0_pos * inverse_vanishing_evals[0]);\n mem.constantTermAccumulator =\n mem.constantTermAccumulator + (proof.geminiAEvaluations[0] * tp.shplonkNu * inverse_vanishing_evals[1]);\n\n // Finalise the batch opening claim\n commitments[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N] = Honk.G1Point({x: 1, y: 2});\n scalars[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N] = mem.constantTermAccumulator;\n\n Honk.G1Point memory quotient_commitment = convertProofPoint(proof.kzgQuotient);\n\n commitments[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 1] = quotient_commitment;\n scalars[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 1] = tp.shplonkZ; // evaluation challenge\n\n Honk.G1Point memory P_0 = batchMul(commitments, scalars);\n Honk.G1Point memory P_1 = negateInplace(quotient_commitment);\n\n return pairing(P_0, P_1);\n }\n\n function computeSquares(Fr r) internal pure returns (Fr[CONST_PROOF_SIZE_LOG_N] memory squares) {\n squares[0] = r;\n for (uint256 i = 1; i < CONST_PROOF_SIZE_LOG_N; ++i) {\n squares[i] = squares[i - 1].sqr();\n }\n }\n\n function computeInvertedGeminiDenominators(\n Transcript memory tp,\n Fr[CONST_PROOF_SIZE_LOG_N] memory eval_challenge_powers\n ) internal view returns (Fr[CONST_PROOF_SIZE_LOG_N + 1] memory inverse_vanishing_evals) {\n Fr eval_challenge = tp.shplonkZ;\n inverse_vanishing_evals[0] = (eval_challenge - eval_challenge_powers[0]).invert();\n\n for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; ++i) {\n Fr round_inverted_denominator = Fr.wrap(0);\n if (i <= LOG_N + 1) {\n round_inverted_denominator = (eval_challenge + eval_challenge_powers[i]).invert();\n }\n inverse_vanishing_evals[i + 1] = round_inverted_denominator;\n }\n }\n\n function computeGeminiBatchedUnivariateEvaluation(\n Transcript memory tp,\n Fr batchedEvalAccumulator,\n Fr[CONST_PROOF_SIZE_LOG_N] memory geminiEvaluations,\n Fr[CONST_PROOF_SIZE_LOG_N] memory geminiEvalChallengePowers\n ) internal view returns (Fr a_0_pos) {\n for (uint256 i = CONST_PROOF_SIZE_LOG_N; i > 0; --i) {\n Fr challengePower = geminiEvalChallengePowers[i - 1];\n Fr u = tp.sumCheckUChallenges[i - 1];\n Fr evalNeg = geminiEvaluations[i - 1];\n\n Fr batchedEvalRoundAcc = (\n (challengePower * batchedEvalAccumulator * Fr.wrap(2))\n - evalNeg * (challengePower * (Fr.wrap(1) - u) - u)\n );\n // Divide by the denominator\n batchedEvalRoundAcc = batchedEvalRoundAcc * (challengePower * (Fr.wrap(1) - u) + u).invert();\n\n bool is_dummy_round = (i > LOG_N);\n if (!is_dummy_round) {\n batchedEvalAccumulator = batchedEvalRoundAcc;\n }\n }\n\n a_0_pos = batchedEvalAccumulator;\n }\n\n // This implementation is the same as above with different constants\n function batchMul(\n Honk.G1Point[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory base,\n Fr[NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2] memory scalars\n ) internal view returns (Honk.G1Point memory result) {\n uint256 limit = NUMBER_OF_ENTITIES + CONST_PROOF_SIZE_LOG_N + 2;\n assembly {\n let success := 0x01\n let free := mload(0x40)\n\n // Write the original into the accumulator\n // Load into memory for ecMUL, leave offset for eccAdd result\n // base is an array of pointers, so we have to dereference them\n mstore(add(free, 0x40), mload(mload(base)))\n mstore(add(free, 0x60), mload(add(0x20, mload(base))))\n // Add scalar\n mstore(add(free, 0x80), mload(scalars))\n success := and(success, staticcall(gas(), 7, add(free, 0x40), 0x60, free, 0x40))\n\n let count := 0x01\n for {} lt(count, limit) { count := add(count, 1) } {\n // Get loop offsets\n let base_base := add(base, mul(count, 0x20))\n let scalar_base := add(scalars, mul(count, 0x20))\n\n mstore(add(free, 0x40), mload(mload(base_base)))\n mstore(add(free, 0x60), mload(add(0x20, mload(base_base))))\n // Add scalar\n mstore(add(free, 0x80), mload(scalar_base))\n\n success := and(success, staticcall(gas(), 7, add(free, 0x40), 0x60, add(free, 0x40), 0x40))\n // accumulator = accumulator + accumulator_2\n success := and(success, staticcall(gas(), 6, free, 0x80, free, 0x40))\n }\n\n // Return the result - i hate this\n mstore(result, mload(free))\n mstore(add(result, 0x20), mload(add(free, 0x20)))\n }\n }\n\n function pairing(Honk.G1Point memory rhs, Honk.G1Point memory lhs) internal view returns (bool) {\n bytes memory input = abi.encodePacked(\n rhs.x,\n rhs.y,\n // Fixed G1 point\n uint256(0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2),\n uint256(0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed),\n uint256(0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b),\n uint256(0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa),\n lhs.x,\n lhs.y,\n // G1 point from VK\n uint256(0x260e01b251f6f1c7e7ff4e580791dee8ea51d87a358e038b4efe30fac09383c1),\n uint256(0x0118c4d5b837bcc2bc89b5b398b5974e9f5944073b32078b7e231fec938883b0),\n uint256(0x04fc6369f7110fe3d25156c1bb9a72859cf2a04641f99ba4ee413c80da6a5fe4),\n uint256(0x22febda3c0c0632a56475b4214e5615e11e6dd3f96e6cea2854a87d4dacc5e55)\n );\n\n (bool success, bytes memory result) = address(0x08).staticcall(input);\n bool decodedResult = abi.decode(result, (bool));\n return success && decodedResult;\n }\n}\n\n// Conversion util - Duplicated as we cannot template LOG_N\nfunction convertPoints(Honk.G1ProofPoint[LOG_N + 1] memory commitments)\n pure\n returns (Honk.G1Point[LOG_N + 1] memory converted)\n{\n for (uint256 i; i < LOG_N + 1; ++i) {\n converted[i] = convertProofPoint(commitments[i]);\n }\n}\n\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 100000000 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/contracts/noir/target/jwt_account_honk.sol b/packages/contracts/noir/target/jwt_account_honk.sol index af9f27b..13d4178 100644 --- a/packages/contracts/noir/target/jwt_account_honk.sol +++ b/packages/contracts/noir/target/jwt_account_honk.sol @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:005a849c9bc064e10c8249ddaed1dc2a596505f61c7b0b9223fd1aff8c8674f1 -size 83036 +oid sha256:31a3341bd22edfcbe9f75c7dd5a8c74eb73bdc05e129fd71b395fee33908bf34 +size 82990 diff --git a/packages/contracts/typechain-types/factories/contracts/SimpleAccountFactory__factory.ts b/packages/contracts/typechain-types/factories/contracts/SimpleAccountFactory__factory.ts index dc1f44c..a12d1e8 100644 --- a/packages/contracts/typechain-types/factories/contracts/SimpleAccountFactory__factory.ts +++ b/packages/contracts/typechain-types/factories/contracts/SimpleAccountFactory__factory.ts @@ -64,7 +64,7 @@ const _abi = [ type: "address", }, { - internalType: "contract UltraVerifier", + internalType: "contract HonkVerifier", name: "proofVerifier", type: "address", }, @@ -105,7 +105,7 @@ const _abi = [ type: "address", }, { - internalType: "contract UltraVerifier", + internalType: "contract HonkVerifier", name: "proofVerifier", type: "address", }, @@ -129,7 +129,7 @@ const _abi = [ ] as const; const _bytecode = - "0x60a060405234801561001057600080fd5b506040516134dd3803806134dd83398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b612af6806109e783390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b6080516109086100df60003960008181604b0152818160c401526101d501526109086000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780638186328814610096578063fa45edfb146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a4366004610348565b6100bc565b61006d6100b7366004610348565b6101a6565b60008060001b7f0000000000000000000000000000000000000000000000000000000000000000836040516024016100f49190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052516101749061033b565b61017f929190610418565b8190604051809103906000f590508015801561019f573d6000803e3d6000fd5b5092915050565b60006102e16000801b604051806020016101bf9061033b565b6020820181038252601f19601f820116604052507f0000000000000000000000000000000000000000000000000000000000000000856040516024016102059190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052905161028a93929101610418565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526102c69291602001610486565b604051602081830303815290604052805190602001206102e7565b92915050565b60006102f48383306102fb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff81536055902073ffffffffffffffffffffffffffffffffffffffff16949350505050565b61041d806104b683390190565b6000608082840312801561035b57600080fd5b509092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461038557600080fd5b50565b81358152602080830135908201526080810160408301356103a881610363565b73ffffffffffffffffffffffffffffffffffffffff16604083015260608301356103d181610363565b73ffffffffffffffffffffffffffffffffffffffff811660608401525092915050565b60005b8381101561040f5781810151838201526020016103f7565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104538160608501602087016103f4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104988184602088016103f4565b8351908301906104ac8183602088016103f4565b0194935050505056fe608060405260405161041d38038061041d83398101604081905261002291610268565b61002c8282610033565b5050610358565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b919061033c565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b038111156102ae57600080fd5b8301601f810185136102bf57600080fd5b80516001600160401b038111156102d8576102d861022e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103065761030661022e565b60405281815282820160200187101561031e57600080fd5b61032f826020830160208601610244565b8093505050509250929050565b6000825161034e818460208701610244565b9190910192915050565b60b7806103666000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220f1b09f534c51785fb64f6d562751f2bfff62c23101c6e5ebe906ffba3b0c3e3164736f6c634300081b0033a26469706673582212208dd45d082afd368ba400cd011f27e09307a1b820c0a0b70bb3b6421028be9b9e64736f6c634300081b003360c06040523060805234801561001457600080fd5b50604051612af6380380612af683398101604081905261003391610100565b6001600160a01b03811660a05261004861004e565b50610130565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561009e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100fd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60006020828403121561011257600080fd5b81516001600160a01b038116811461012957600080fd5b9392505050565b60805160a05161296961018d60003960008181610425015281816107f3015281816108a101528181610df201528181610eb001528181610ef701526110ce0152600081816112cd015281816112f6015261151201526129696000f3fe6080604052600436106101635760003560e01c8063ad3cb1cc116100c0578063b6f360fb11610074578063c399ec8811610059578063c399ec8814610527578063d087d2881461053c578063f23a6e611461055157600080fd5b8063b6f360fb146104bf578063bc197c81146104df57600080fd5b8063b2e684be116100a5578063b2e684be1461046a578063b387ef921461048a578063b61d27f61461049f57600080fd5b8063ad3cb1cc146103c0578063b0d691fe1461041657600080fd5b80634bd834c7116101175780634f1ef286116100fc5780634f1ef2861461032057806352d1902d146103335780637a28f8bc1461034857600080fd5b80634bd834c7146102725780634d44560d1461030057600080fd5b806319822f7c1161014857806319822f7c1461021a57806334fcd5be146102485780634a58db191461026a57600080fd5b806301ffc9a71461016f578063150b7a02146101a457600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b5061018f61018a366004611ef4565b610597565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101e96101bf366004611fa1565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161019b565b34801561022657600080fd5b5061023a610235366004612014565b61067c565b60405190815260200161019b565b34801561025457600080fd5b506102686102633660046120ad565b610708565b005b6102686107f1565b34801561027e57600080fd5b506000546102c79073ffffffffffffffffffffffffffffffffffffffff8116907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff90911660208301520161019b565b34801561030c57600080fd5b5061026861031b3660046120ef565b610897565b61026861032e3660046121f7565b61094e565b34801561033f57600080fd5b5061023a61096d565b34801561035457600080fd5b5060015460025460035460045461038493929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff9182169284019290925216606082015260800161019b565b3480156103cc57600080fd5b506104096040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161019b91906122b5565b34801561042257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561047657600080fd5b506102686104853660046122e0565b61099c565b34801561049657600080fd5b50610445610b6c565b3480156104ab57600080fd5b506102686104ba366004612315565b610bd8565b3480156104cb57600080fd5b506102686104da366004612371565b610c27565b3480156104eb57600080fd5b506101e96104fa36600461238d565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561053357600080fd5b5061023a610dac565b34801561054857600080fd5b5061023a610e63565b34801561055d57600080fd5b506101e961056c366004612458565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60007fb2e684be000000000000000000000000000000000000000000000000000000006106ac60608601866124d4565b6106b591612539565b7fffffffff0000000000000000000000000000000000000000000000000000000016036106e457506000610701565b6106ec610edf565b6106f68484610f80565b90506107018261104b565b9392505050565b6107106110b6565b60005b818110156107ec576107e48383838181106107305761073061259f565b905060200281019061074291906125ce565b61075090602081019061260c565b8484848181106107625761076261259f565b905060200281019061077491906125ce565b6020013585858581811061078a5761078a61259f565b905060200281019061079c91906125ce565b6107aa9060408101906124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b600101610713565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b5050505050565b61089f61120f565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050505050565b6109566112b5565b61095f826113b9565b61096982826113c1565b5050565b60006109776114fa565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b426109ad610e106020840135612658565b1015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20657870697265642070726f6f660000000000000060448201526064015b60405180910390fd5b604080516080810182526001548152600254602082015260035473ffffffffffffffffffffffffffffffffffffffff908116928201929092526004549091166060820152600090610a7390610a6e8461266b565b611569565b905080610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f66000000000000006044820152606401610a11565b6040518060400160405280836040013560001c73ffffffffffffffffffffffffffffffffffffffff1681526020016201518042610b1991906126ee565b6bffffffffffffffffffffffff908116909152815160209092015116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116176000555050565b604080518082019091526000805473ffffffffffffffffffffffffffffffffffffffff811683527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208301819052909190421115610bd257600091505090565b51919050565b610be06110b6565b610c21848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610c725750825b905060008267ffffffffffffffff166001148015610c8f5750303b155b905081158015610c9d575080155b15610cd4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610d355784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b856001610d428282612712565b505083156109465784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e91906127c6565b905090565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610e1d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610a11565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610ffb81610fc16101008701876124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061185592505050565b73ffffffffffffffffffffffffffffffffffffffff16611019610b6c565b73ffffffffffffffffffffffffffffffffffffffff161461103e576001915050610676565b5060009392505050565b50565b80156110485760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610890565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061112c57506110fd610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152606401610a11565b6000808473ffffffffffffffffffffffffffffffffffffffff1684846040516111bb91906127df565b60006040518083038185875af1925050503d80600081146111f8576040519150601f19603f3d011682016040523d82523d6000602084013e6111fd565b606091505b50915091508161089057805160208201fd5b611217610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061124f57503330145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152606401610a11565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061138257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166113697f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61104861120f565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611446575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611443918101906127c6565b60015b611494576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146114f0576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6107ec838361187f565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016115bb929190918252602082015260400190565b602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc91906127f1565b611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610a11565b600061167183604001516118e2565b80519091506003906000906116869083612658565b67ffffffffffffffff81111561169e5761169e61211b565b6040519080825280602002602001820160405280156116c7578160200160208202803683370190505b50865190915060009082826116db81612813565b9350815181106116ed576116ed61259f565b602002602001018181525050856020015160001b82828061170d90612813565b93508151811061171f5761171f61259f565b60209081029190910101526060860151828261173a81612813565b93508151811061174c5761174c61259f565b60200260200101818152505060005b84518110156117ae578481815181106117765761177661259f565b016020015160f81c838361178981612813565b94508151811061179b5761179b61259f565b602090810291909101015260010161175b565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e49161180991869060040161284b565b602060405180830381865afa158015611826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184a91906127f1565b979650505050505050565b60008060008061186586866118ef565b925092509250611875828261193c565b5090949350505050565b61188882611a40565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118da576107ec8282611b0f565b610969611b92565b6060610676826020611bca565b600080600083516041036119295760208401516040850151606086015160001a61191b88828585611d29565b955095509550505050611935565b50508151600091506002905b9250925092565b6000826003811115611950576119506128a5565b03611959575050565b600182600381111561196d5761196d6128a5565b036119a4576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156119b8576119b86128a5565b036119f2576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6003826003811115611a0657611a066128a5565b03610969576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611aa9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051611b3991906127df565b600060405180830381855af49150503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5091509150611b89858383611e23565b95945050505050565b3415610f7e576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826000611bda8460026128d4565b67ffffffffffffffff811115611bf257611bf261211b565b6040519080825280601f01601f191660200182016040528015611c1c576020820181803683370190505b5090506000611c2c8560026128d4565b611c37906001612658565b90505b6001811115611cde577f303132333435363738396162636465660000000000000000000000000000000083600f1660108110611c7857611c7861259f565b1a60f81b82611c886002846128eb565b81518110611c9857611c9861259f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c91611cd7816128fe565b9050611c3a565b508115611d21576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610a11565b949350505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611d645750600091506003905082611e19565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611db8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611e0f57506000925060019150829050611e19565b9250600091508190505b9450945094915050565b606082611e3857611e3382611eb2565b610701565b8151158015611e5c575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611eab576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610a11565b5080610701565b805115611ec25780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215611f0657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461104857600080fd5b60008083601f840112611f6a57600080fd5b50813567ffffffffffffffff811115611f8257600080fd5b602083019150836020828501011115611f9a57600080fd5b9250929050565b600080600080600060808688031215611fb957600080fd5b8535611fc481611f36565b94506020860135611fd481611f36565b935060408601359250606086013567ffffffffffffffff811115611ff757600080fd5b61200388828901611f58565b969995985093965092949392505050565b60008060006060848603121561202957600080fd5b833567ffffffffffffffff81111561204057600080fd5b8401610120818703121561205357600080fd5b95602085013595506040909401359392505050565b60008083601f84011261207a57600080fd5b50813567ffffffffffffffff81111561209257600080fd5b6020830191508360208260051b8501011115611f9a57600080fd5b600080602083850312156120c057600080fd5b823567ffffffffffffffff8111156120d757600080fd5b6120e385828601612068565b90969095509350505050565b6000806040838503121561210257600080fd5b823561210d81611f36565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261215b57600080fd5b813567ffffffffffffffff8111156121755761217561211b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156121c2576121c261211b565b6040528181528382016020018510156121da57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561220a57600080fd5b823561221581611f36565b9150602083013567ffffffffffffffff81111561223157600080fd5b61223d8582860161214a565b9150509250929050565b60005b8381101561226257818101518382015260200161224a565b50506000910152565b60008151808452612283816020860160208601612247565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610701602083018461226b565b6000608082840312156122da57600080fd5b50919050565b6000602082840312156122f257600080fd5b813567ffffffffffffffff81111561230957600080fd5b611d21848285016122c8565b6000806000806060858703121561232b57600080fd5b843561233681611f36565b935060208501359250604085013567ffffffffffffffff81111561235957600080fd5b61236587828801611f58565b95989497509550505050565b60006080828403121561238357600080fd5b61070183836122c8565b60008060008060008060008060a0898b0312156123a957600080fd5b88356123b481611f36565b975060208901356123c481611f36565b9650604089013567ffffffffffffffff8111156123e057600080fd5b6123ec8b828c01612068565b909750955050606089013567ffffffffffffffff81111561240c57600080fd5b6124188b828c01612068565b909550935050608089013567ffffffffffffffff81111561243857600080fd5b6124448b828c01611f58565b999c989b5096995094979396929594505050565b60008060008060008060a0878903121561247157600080fd5b863561247c81611f36565b9550602087013561248c81611f36565b94506040870135935060608701359250608087013567ffffffffffffffff8111156124b657600080fd5b6124c289828a01611f58565b979a9699509497509295939492505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261250957600080fd5b83018035915067ffffffffffffffff82111561252457600080fd5b602001915036819003821315611f9a57600080fd5b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015612598577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261260257600080fd5b9190910192915050565b60006020828403121561261e57600080fd5b813561070181611f36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561067657610676612629565b60006080823603121561267d57600080fd5b6040516080810167ffffffffffffffff811182821017156126a0576126a061211b565b604052823567ffffffffffffffff8111156126ba57600080fd5b6126c63682860161214a565b8252506020838101359082015260408084013590820152606092830135928101929092525090565b6bffffffffffffffffffffffff818116838216019081111561067657610676612629565b8135815560208201356001820155604082013561272e81611f36565b6002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905550606082013561277f81611f36565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055505050565b6000602082840312156127d857600080fd5b5051919050565b60008251612602818460208701612247565b60006020828403121561280357600080fd5b8151801515811461070157600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361284457612844612629565b5060010190565b60408152600061285e604083018561226b565b828103602084015280845180835260208301915060208601925060005b8181101561289957835183526020938401939092019160010161287b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b808202811582820484141761067657610676612629565b8181038181111561067657610676612629565b60008161290d5761290d612629565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212202ffaebc956cf206ecce7d0b751c6aea797e4821b45a54ec89796f56c882d703f64736f6c634300081b0033"; + "0x60a060405234801561001057600080fd5b506040516134dd3803806134dd83398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b612af6806109e783390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b6080516109086100df60003960008181604b0152818160c401526101d501526109086000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780638186328814610096578063fa45edfb146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a4366004610348565b6100bc565b61006d6100b7366004610348565b6101a6565b60008060001b7f0000000000000000000000000000000000000000000000000000000000000000836040516024016100f49190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052516101749061033b565b61017f929190610418565b8190604051809103906000f590508015801561019f573d6000803e3d6000fd5b5092915050565b60006102e16000801b604051806020016101bf9061033b565b6020820181038252601f19601f820116604052507f0000000000000000000000000000000000000000000000000000000000000000856040516024016102059190610388565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb6f360fb00000000000000000000000000000000000000000000000000000000179052905161028a93929101610418565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526102c69291602001610486565b604051602081830303815290604052805190602001206102e7565b92915050565b60006102f48383306102fb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff81536055902073ffffffffffffffffffffffffffffffffffffffff16949350505050565b61041d806104b683390190565b6000608082840312801561035b57600080fd5b509092915050565b73ffffffffffffffffffffffffffffffffffffffff8116811461038557600080fd5b50565b81358152602080830135908201526080810160408301356103a881610363565b73ffffffffffffffffffffffffffffffffffffffff16604083015260608301356103d181610363565b73ffffffffffffffffffffffffffffffffffffffff811660608401525092915050565b60005b8381101561040f5781810151838201526020016103f7565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104538160608501602087016103f4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104988184602088016103f4565b8351908301906104ac8183602088016103f4565b0194935050505056fe608060405260405161041d38038061041d83398101604081905261002291610268565b61002c8282610033565b5050610358565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b919061033c565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b038111156102ae57600080fd5b8301601f810185136102bf57600080fd5b80516001600160401b038111156102d8576102d861022e565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103065761030661022e565b60405281815282820160200187101561031e57600080fd5b61032f826020830160208601610244565b8093505050509250929050565b6000825161034e818460208701610244565b9190910192915050565b60b7806103666000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220f1b09f534c51785fb64f6d562751f2bfff62c23101c6e5ebe906ffba3b0c3e3164736f6c634300081b0033a26469706673582212201f8d7d348f8b56e137c408e046670fd22c23febe5363bd975d12a87410e9ba7e64736f6c634300081b003360c06040523060805234801561001457600080fd5b50604051612af6380380612af683398101604081905261003391610100565b6001600160a01b03811660a05261004861004e565b50610130565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561009e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100fd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60006020828403121561011257600080fd5b81516001600160a01b038116811461012957600080fd5b9392505050565b60805160a05161296961018d60003960008181610425015281816107f3015281816108a101528181610df201528181610eb001528181610ef701526110ce0152600081816112cd015281816112f6015261151201526129696000f3fe6080604052600436106101635760003560e01c8063ad3cb1cc116100c0578063b6f360fb11610074578063c399ec8811610059578063c399ec8814610527578063d087d2881461053c578063f23a6e611461055157600080fd5b8063b6f360fb146104bf578063bc197c81146104df57600080fd5b8063b2e684be116100a5578063b2e684be1461046a578063b387ef921461048a578063b61d27f61461049f57600080fd5b8063ad3cb1cc146103c0578063b0d691fe1461041657600080fd5b80634bd834c7116101175780634f1ef286116100fc5780634f1ef2861461032057806352d1902d146103335780637a28f8bc1461034857600080fd5b80634bd834c7146102725780634d44560d1461030057600080fd5b806319822f7c1161014857806319822f7c1461021a57806334fcd5be146102485780634a58db191461026a57600080fd5b806301ffc9a71461016f578063150b7a02146101a457600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b5061018f61018a366004611ef4565b610597565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101e96101bf366004611fa1565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161019b565b34801561022657600080fd5b5061023a610235366004612014565b61067c565b60405190815260200161019b565b34801561025457600080fd5b506102686102633660046120ad565b610708565b005b6102686107f1565b34801561027e57600080fd5b506000546102c79073ffffffffffffffffffffffffffffffffffffffff8116907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff90911660208301520161019b565b34801561030c57600080fd5b5061026861031b3660046120ef565b610897565b61026861032e3660046121f7565b61094e565b34801561033f57600080fd5b5061023a61096d565b34801561035457600080fd5b5060015460025460035460045461038493929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff9182169284019290925216606082015260800161019b565b3480156103cc57600080fd5b506104096040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161019b91906122b5565b34801561042257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561047657600080fd5b506102686104853660046122e0565b61099c565b34801561049657600080fd5b50610445610b6c565b3480156104ab57600080fd5b506102686104ba366004612315565b610bd8565b3480156104cb57600080fd5b506102686104da366004612371565b610c27565b3480156104eb57600080fd5b506101e96104fa36600461238d565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561053357600080fd5b5061023a610dac565b34801561054857600080fd5b5061023a610e63565b34801561055d57600080fd5b506101e961056c366004612458565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60007fb2e684be000000000000000000000000000000000000000000000000000000006106ac60608601866124d4565b6106b591612539565b7fffffffff0000000000000000000000000000000000000000000000000000000016036106e457506000610701565b6106ec610edf565b6106f68484610f80565b90506107018261104b565b9392505050565b6107106110b6565b60005b818110156107ec576107e48383838181106107305761073061259f565b905060200281019061074291906125ce565b61075090602081019061260c565b8484848181106107625761076261259f565b905060200281019061077491906125ce565b6020013585858581811061078a5761078a61259f565b905060200281019061079c91906125ce565b6107aa9060408101906124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b600101610713565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b5050505050565b61089f61120f565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050505050565b6109566112b5565b61095f826113b9565b61096982826113c1565b5050565b60006109776114fa565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b426109ad610e106020840135612658565b1015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20657870697265642070726f6f660000000000000060448201526064015b60405180910390fd5b604080516080810182526001548152600254602082015260035473ffffffffffffffffffffffffffffffffffffffff908116928201929092526004549091166060820152600090610a7390610a6e8461266b565b611569565b905080610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f66000000000000006044820152606401610a11565b6040518060400160405280836040013560001c73ffffffffffffffffffffffffffffffffffffffff1681526020016201518042610b1991906126ee565b6bffffffffffffffffffffffff908116909152815160209092015116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116176000555050565b604080518082019091526000805473ffffffffffffffffffffffffffffffffffffffff811683527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208301819052909190421115610bd257600091505090565b51919050565b610be06110b6565b610c21848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610c725750825b905060008267ffffffffffffffff166001148015610c8f5750303b155b905081158015610c9d575080155b15610cd4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610d355784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b856001610d428282612712565b505083156109465784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e91906127c6565b905090565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610e1d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610a11565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610ffb81610fc16101008701876124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061185592505050565b73ffffffffffffffffffffffffffffffffffffffff16611019610b6c565b73ffffffffffffffffffffffffffffffffffffffff161461103e576001915050610676565b5060009392505050565b50565b80156110485760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610890565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061112c57506110fd610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152606401610a11565b6000808473ffffffffffffffffffffffffffffffffffffffff1684846040516111bb91906127df565b60006040518083038185875af1925050503d80600081146111f8576040519150601f19603f3d011682016040523d82523d6000602084013e6111fd565b606091505b50915091508161089057805160208201fd5b611217610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061124f57503330145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152606401610a11565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061138257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166113697f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61104861120f565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611446575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611443918101906127c6565b60015b611494576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146114f0576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6107ec838361187f565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016115bb929190918252602082015260400190565b602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc91906127f1565b611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610a11565b600061167183604001516118e2565b80519091506003906000906116869083612658565b67ffffffffffffffff81111561169e5761169e61211b565b6040519080825280602002602001820160405280156116c7578160200160208202803683370190505b50865190915060009082826116db81612813565b9350815181106116ed576116ed61259f565b602002602001018181525050856020015160001b82828061170d90612813565b93508151811061171f5761171f61259f565b60209081029190910101526060860151828261173a81612813565b93508151811061174c5761174c61259f565b60200260200101818152505060005b84518110156117ae578481815181106117765761177661259f565b016020015160f81c838361178981612813565b94508151811061179b5761179b61259f565b602090810291909101015260010161175b565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e49161180991869060040161284b565b602060405180830381865afa158015611826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184a91906127f1565b979650505050505050565b60008060008061186586866118ef565b925092509250611875828261193c565b5090949350505050565b61188882611a40565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118da576107ec8282611b0f565b610969611b92565b6060610676826020611bca565b600080600083516041036119295760208401516040850151606086015160001a61191b88828585611d29565b955095509550505050611935565b50508151600091506002905b9250925092565b6000826003811115611950576119506128a5565b03611959575050565b600182600381111561196d5761196d6128a5565b036119a4576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156119b8576119b86128a5565b036119f2576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6003826003811115611a0657611a066128a5565b03610969576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611aa9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051611b3991906127df565b600060405180830381855af49150503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5091509150611b89858383611e23565b95945050505050565b3415610f7e576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826000611bda8460026128d4565b67ffffffffffffffff811115611bf257611bf261211b565b6040519080825280601f01601f191660200182016040528015611c1c576020820181803683370190505b5090506000611c2c8560026128d4565b611c37906001612658565b90505b6001811115611cde577f303132333435363738396162636465660000000000000000000000000000000083600f1660108110611c7857611c7861259f565b1a60f81b82611c886002846128eb565b81518110611c9857611c9861259f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c91611cd7816128fe565b9050611c3a565b508115611d21576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610a11565b949350505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611d645750600091506003905082611e19565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611db8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611e0f57506000925060019150829050611e19565b9250600091508190505b9450945094915050565b606082611e3857611e3382611eb2565b610701565b8151158015611e5c575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611eab576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610a11565b5080610701565b805115611ec25780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215611f0657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461104857600080fd5b60008083601f840112611f6a57600080fd5b50813567ffffffffffffffff811115611f8257600080fd5b602083019150836020828501011115611f9a57600080fd5b9250929050565b600080600080600060808688031215611fb957600080fd5b8535611fc481611f36565b94506020860135611fd481611f36565b935060408601359250606086013567ffffffffffffffff811115611ff757600080fd5b61200388828901611f58565b969995985093965092949392505050565b60008060006060848603121561202957600080fd5b833567ffffffffffffffff81111561204057600080fd5b8401610120818703121561205357600080fd5b95602085013595506040909401359392505050565b60008083601f84011261207a57600080fd5b50813567ffffffffffffffff81111561209257600080fd5b6020830191508360208260051b8501011115611f9a57600080fd5b600080602083850312156120c057600080fd5b823567ffffffffffffffff8111156120d757600080fd5b6120e385828601612068565b90969095509350505050565b6000806040838503121561210257600080fd5b823561210d81611f36565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261215b57600080fd5b813567ffffffffffffffff8111156121755761217561211b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156121c2576121c261211b565b6040528181528382016020018510156121da57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561220a57600080fd5b823561221581611f36565b9150602083013567ffffffffffffffff81111561223157600080fd5b61223d8582860161214a565b9150509250929050565b60005b8381101561226257818101518382015260200161224a565b50506000910152565b60008151808452612283816020860160208601612247565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610701602083018461226b565b6000608082840312156122da57600080fd5b50919050565b6000602082840312156122f257600080fd5b813567ffffffffffffffff81111561230957600080fd5b611d21848285016122c8565b6000806000806060858703121561232b57600080fd5b843561233681611f36565b935060208501359250604085013567ffffffffffffffff81111561235957600080fd5b61236587828801611f58565b95989497509550505050565b60006080828403121561238357600080fd5b61070183836122c8565b60008060008060008060008060a0898b0312156123a957600080fd5b88356123b481611f36565b975060208901356123c481611f36565b9650604089013567ffffffffffffffff8111156123e057600080fd5b6123ec8b828c01612068565b909750955050606089013567ffffffffffffffff81111561240c57600080fd5b6124188b828c01612068565b909550935050608089013567ffffffffffffffff81111561243857600080fd5b6124448b828c01611f58565b999c989b5096995094979396929594505050565b60008060008060008060a0878903121561247157600080fd5b863561247c81611f36565b9550602087013561248c81611f36565b94506040870135935060608701359250608087013567ffffffffffffffff8111156124b657600080fd5b6124c289828a01611f58565b979a9699509497509295939492505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261250957600080fd5b83018035915067ffffffffffffffff82111561252457600080fd5b602001915036819003821315611f9a57600080fd5b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015612598577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261260257600080fd5b9190910192915050565b60006020828403121561261e57600080fd5b813561070181611f36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561067657610676612629565b60006080823603121561267d57600080fd5b6040516080810167ffffffffffffffff811182821017156126a0576126a061211b565b604052823567ffffffffffffffff8111156126ba57600080fd5b6126c63682860161214a565b8252506020838101359082015260408084013590820152606092830135928101929092525090565b6bffffffffffffffffffffffff818116838216019081111561067657610676612629565b8135815560208201356001820155604082013561272e81611f36565b6002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905550606082013561277f81611f36565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055505050565b6000602082840312156127d857600080fd5b5051919050565b60008251612602818460208701612247565b60006020828403121561280357600080fd5b8151801515811461070157600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361284457612844612629565b5060010190565b60408152600061285e604083018561226b565b828103602084015280845180835260208301915060208601925060005b8181101561289957835183526020938401939092019160010161287b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b808202811582820484141761067657610676612629565b8181038181111561067657610676612629565b60008161290d5761290d612629565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212201713b23e80ac60dbf62058f5b0d11b6f5912c9a45cf6e3d29182f94852be320e64736f6c634300081b0033"; type SimpleAccountFactoryConstructorParams = | [signer?: Signer] diff --git a/packages/contracts/typechain-types/factories/contracts/SimpleAccount__factory.ts b/packages/contracts/typechain-types/factories/contracts/SimpleAccount__factory.ts index ad33768..91509ab 100644 --- a/packages/contracts/typechain-types/factories/contracts/SimpleAccount__factory.ts +++ b/packages/contracts/typechain-types/factories/contracts/SimpleAccount__factory.ts @@ -191,7 +191,7 @@ const _abi = [ type: "address", }, { - internalType: "contract UltraVerifier", + internalType: "contract HonkVerifier", name: "proofVerifier", type: "address", }, @@ -331,7 +331,7 @@ const _abi = [ type: "address", }, { - internalType: "contract UltraVerifier", + internalType: "contract HonkVerifier", name: "proofVerifier", type: "address", }, @@ -662,7 +662,7 @@ const _abi = [ ] as const; const _bytecode = - "0x60c06040523060805234801561001457600080fd5b50604051612af6380380612af683398101604081905261003391610100565b6001600160a01b03811660a05261004861004e565b50610130565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561009e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100fd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60006020828403121561011257600080fd5b81516001600160a01b038116811461012957600080fd5b9392505050565b60805160a05161296961018d60003960008181610425015281816107f3015281816108a101528181610df201528181610eb001528181610ef701526110ce0152600081816112cd015281816112f6015261151201526129696000f3fe6080604052600436106101635760003560e01c8063ad3cb1cc116100c0578063b6f360fb11610074578063c399ec8811610059578063c399ec8814610527578063d087d2881461053c578063f23a6e611461055157600080fd5b8063b6f360fb146104bf578063bc197c81146104df57600080fd5b8063b2e684be116100a5578063b2e684be1461046a578063b387ef921461048a578063b61d27f61461049f57600080fd5b8063ad3cb1cc146103c0578063b0d691fe1461041657600080fd5b80634bd834c7116101175780634f1ef286116100fc5780634f1ef2861461032057806352d1902d146103335780637a28f8bc1461034857600080fd5b80634bd834c7146102725780634d44560d1461030057600080fd5b806319822f7c1161014857806319822f7c1461021a57806334fcd5be146102485780634a58db191461026a57600080fd5b806301ffc9a71461016f578063150b7a02146101a457600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b5061018f61018a366004611ef4565b610597565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101e96101bf366004611fa1565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161019b565b34801561022657600080fd5b5061023a610235366004612014565b61067c565b60405190815260200161019b565b34801561025457600080fd5b506102686102633660046120ad565b610708565b005b6102686107f1565b34801561027e57600080fd5b506000546102c79073ffffffffffffffffffffffffffffffffffffffff8116907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff90911660208301520161019b565b34801561030c57600080fd5b5061026861031b3660046120ef565b610897565b61026861032e3660046121f7565b61094e565b34801561033f57600080fd5b5061023a61096d565b34801561035457600080fd5b5060015460025460035460045461038493929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff9182169284019290925216606082015260800161019b565b3480156103cc57600080fd5b506104096040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161019b91906122b5565b34801561042257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561047657600080fd5b506102686104853660046122e0565b61099c565b34801561049657600080fd5b50610445610b6c565b3480156104ab57600080fd5b506102686104ba366004612315565b610bd8565b3480156104cb57600080fd5b506102686104da366004612371565b610c27565b3480156104eb57600080fd5b506101e96104fa36600461238d565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561053357600080fd5b5061023a610dac565b34801561054857600080fd5b5061023a610e63565b34801561055d57600080fd5b506101e961056c366004612458565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60007fb2e684be000000000000000000000000000000000000000000000000000000006106ac60608601866124d4565b6106b591612539565b7fffffffff0000000000000000000000000000000000000000000000000000000016036106e457506000610701565b6106ec610edf565b6106f68484610f80565b90506107018261104b565b9392505050565b6107106110b6565b60005b818110156107ec576107e48383838181106107305761073061259f565b905060200281019061074291906125ce565b61075090602081019061260c565b8484848181106107625761076261259f565b905060200281019061077491906125ce565b6020013585858581811061078a5761078a61259f565b905060200281019061079c91906125ce565b6107aa9060408101906124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b600101610713565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b5050505050565b61089f61120f565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050505050565b6109566112b5565b61095f826113b9565b61096982826113c1565b5050565b60006109776114fa565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b426109ad610e106020840135612658565b1015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20657870697265642070726f6f660000000000000060448201526064015b60405180910390fd5b604080516080810182526001548152600254602082015260035473ffffffffffffffffffffffffffffffffffffffff908116928201929092526004549091166060820152600090610a7390610a6e8461266b565b611569565b905080610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f66000000000000006044820152606401610a11565b6040518060400160405280836040013560001c73ffffffffffffffffffffffffffffffffffffffff1681526020016201518042610b1991906126ee565b6bffffffffffffffffffffffff908116909152815160209092015116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116176000555050565b604080518082019091526000805473ffffffffffffffffffffffffffffffffffffffff811683527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208301819052909190421115610bd257600091505090565b51919050565b610be06110b6565b610c21848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610c725750825b905060008267ffffffffffffffff166001148015610c8f5750303b155b905081158015610c9d575080155b15610cd4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610d355784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b856001610d428282612712565b505083156109465784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e91906127c6565b905090565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610e1d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610a11565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610ffb81610fc16101008701876124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061185592505050565b73ffffffffffffffffffffffffffffffffffffffff16611019610b6c565b73ffffffffffffffffffffffffffffffffffffffff161461103e576001915050610676565b5060009392505050565b50565b80156110485760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610890565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061112c57506110fd610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152606401610a11565b6000808473ffffffffffffffffffffffffffffffffffffffff1684846040516111bb91906127df565b60006040518083038185875af1925050503d80600081146111f8576040519150601f19603f3d011682016040523d82523d6000602084013e6111fd565b606091505b50915091508161089057805160208201fd5b611217610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061124f57503330145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152606401610a11565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061138257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166113697f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61104861120f565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611446575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611443918101906127c6565b60015b611494576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146114f0576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6107ec838361187f565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016115bb929190918252602082015260400190565b602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc91906127f1565b611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610a11565b600061167183604001516118e2565b80519091506003906000906116869083612658565b67ffffffffffffffff81111561169e5761169e61211b565b6040519080825280602002602001820160405280156116c7578160200160208202803683370190505b50865190915060009082826116db81612813565b9350815181106116ed576116ed61259f565b602002602001018181525050856020015160001b82828061170d90612813565b93508151811061171f5761171f61259f565b60209081029190910101526060860151828261173a81612813565b93508151811061174c5761174c61259f565b60200260200101818152505060005b84518110156117ae578481815181106117765761177661259f565b016020015160f81c838361178981612813565b94508151811061179b5761179b61259f565b602090810291909101015260010161175b565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e49161180991869060040161284b565b602060405180830381865afa158015611826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184a91906127f1565b979650505050505050565b60008060008061186586866118ef565b925092509250611875828261193c565b5090949350505050565b61188882611a40565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118da576107ec8282611b0f565b610969611b92565b6060610676826020611bca565b600080600083516041036119295760208401516040850151606086015160001a61191b88828585611d29565b955095509550505050611935565b50508151600091506002905b9250925092565b6000826003811115611950576119506128a5565b03611959575050565b600182600381111561196d5761196d6128a5565b036119a4576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156119b8576119b86128a5565b036119f2576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6003826003811115611a0657611a066128a5565b03610969576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611aa9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051611b3991906127df565b600060405180830381855af49150503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5091509150611b89858383611e23565b95945050505050565b3415610f7e576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826000611bda8460026128d4565b67ffffffffffffffff811115611bf257611bf261211b565b6040519080825280601f01601f191660200182016040528015611c1c576020820181803683370190505b5090506000611c2c8560026128d4565b611c37906001612658565b90505b6001811115611cde577f303132333435363738396162636465660000000000000000000000000000000083600f1660108110611c7857611c7861259f565b1a60f81b82611c886002846128eb565b81518110611c9857611c9861259f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c91611cd7816128fe565b9050611c3a565b508115611d21576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610a11565b949350505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611d645750600091506003905082611e19565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611db8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611e0f57506000925060019150829050611e19565b9250600091508190505b9450945094915050565b606082611e3857611e3382611eb2565b610701565b8151158015611e5c575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611eab576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610a11565b5080610701565b805115611ec25780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215611f0657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461104857600080fd5b60008083601f840112611f6a57600080fd5b50813567ffffffffffffffff811115611f8257600080fd5b602083019150836020828501011115611f9a57600080fd5b9250929050565b600080600080600060808688031215611fb957600080fd5b8535611fc481611f36565b94506020860135611fd481611f36565b935060408601359250606086013567ffffffffffffffff811115611ff757600080fd5b61200388828901611f58565b969995985093965092949392505050565b60008060006060848603121561202957600080fd5b833567ffffffffffffffff81111561204057600080fd5b8401610120818703121561205357600080fd5b95602085013595506040909401359392505050565b60008083601f84011261207a57600080fd5b50813567ffffffffffffffff81111561209257600080fd5b6020830191508360208260051b8501011115611f9a57600080fd5b600080602083850312156120c057600080fd5b823567ffffffffffffffff8111156120d757600080fd5b6120e385828601612068565b90969095509350505050565b6000806040838503121561210257600080fd5b823561210d81611f36565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261215b57600080fd5b813567ffffffffffffffff8111156121755761217561211b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156121c2576121c261211b565b6040528181528382016020018510156121da57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561220a57600080fd5b823561221581611f36565b9150602083013567ffffffffffffffff81111561223157600080fd5b61223d8582860161214a565b9150509250929050565b60005b8381101561226257818101518382015260200161224a565b50506000910152565b60008151808452612283816020860160208601612247565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610701602083018461226b565b6000608082840312156122da57600080fd5b50919050565b6000602082840312156122f257600080fd5b813567ffffffffffffffff81111561230957600080fd5b611d21848285016122c8565b6000806000806060858703121561232b57600080fd5b843561233681611f36565b935060208501359250604085013567ffffffffffffffff81111561235957600080fd5b61236587828801611f58565b95989497509550505050565b60006080828403121561238357600080fd5b61070183836122c8565b60008060008060008060008060a0898b0312156123a957600080fd5b88356123b481611f36565b975060208901356123c481611f36565b9650604089013567ffffffffffffffff8111156123e057600080fd5b6123ec8b828c01612068565b909750955050606089013567ffffffffffffffff81111561240c57600080fd5b6124188b828c01612068565b909550935050608089013567ffffffffffffffff81111561243857600080fd5b6124448b828c01611f58565b999c989b5096995094979396929594505050565b60008060008060008060a0878903121561247157600080fd5b863561247c81611f36565b9550602087013561248c81611f36565b94506040870135935060608701359250608087013567ffffffffffffffff8111156124b657600080fd5b6124c289828a01611f58565b979a9699509497509295939492505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261250957600080fd5b83018035915067ffffffffffffffff82111561252457600080fd5b602001915036819003821315611f9a57600080fd5b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015612598577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261260257600080fd5b9190910192915050565b60006020828403121561261e57600080fd5b813561070181611f36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561067657610676612629565b60006080823603121561267d57600080fd5b6040516080810167ffffffffffffffff811182821017156126a0576126a061211b565b604052823567ffffffffffffffff8111156126ba57600080fd5b6126c63682860161214a565b8252506020838101359082015260408084013590820152606092830135928101929092525090565b6bffffffffffffffffffffffff818116838216019081111561067657610676612629565b8135815560208201356001820155604082013561272e81611f36565b6002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905550606082013561277f81611f36565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055505050565b6000602082840312156127d857600080fd5b5051919050565b60008251612602818460208701612247565b60006020828403121561280357600080fd5b8151801515811461070157600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361284457612844612629565b5060010190565b60408152600061285e604083018561226b565b828103602084015280845180835260208301915060208601925060005b8181101561289957835183526020938401939092019160010161287b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b808202811582820484141761067657610676612629565b8181038181111561067657610676612629565b60008161290d5761290d612629565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212202ffaebc956cf206ecce7d0b751c6aea797e4821b45a54ec89796f56c882d703f64736f6c634300081b0033"; + "0x60c06040523060805234801561001457600080fd5b50604051612af6380380612af683398101604081905261003391610100565b6001600160a01b03811660a05261004861004e565b50610130565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561009e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100fd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60006020828403121561011257600080fd5b81516001600160a01b038116811461012957600080fd5b9392505050565b60805160a05161296961018d60003960008181610425015281816107f3015281816108a101528181610df201528181610eb001528181610ef701526110ce0152600081816112cd015281816112f6015261151201526129696000f3fe6080604052600436106101635760003560e01c8063ad3cb1cc116100c0578063b6f360fb11610074578063c399ec8811610059578063c399ec8814610527578063d087d2881461053c578063f23a6e611461055157600080fd5b8063b6f360fb146104bf578063bc197c81146104df57600080fd5b8063b2e684be116100a5578063b2e684be1461046a578063b387ef921461048a578063b61d27f61461049f57600080fd5b8063ad3cb1cc146103c0578063b0d691fe1461041657600080fd5b80634bd834c7116101175780634f1ef286116100fc5780634f1ef2861461032057806352d1902d146103335780637a28f8bc1461034857600080fd5b80634bd834c7146102725780634d44560d1461030057600080fd5b806319822f7c1161014857806319822f7c1461021a57806334fcd5be146102485780634a58db191461026a57600080fd5b806301ffc9a71461016f578063150b7a02146101a457600080fd5b3661016a57005b600080fd5b34801561017b57600080fd5b5061018f61018a366004611ef4565b610597565b60405190151581526020015b60405180910390f35b3480156101b057600080fd5b506101e96101bf366004611fa1565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161019b565b34801561022657600080fd5b5061023a610235366004612014565b61067c565b60405190815260200161019b565b34801561025457600080fd5b506102686102633660046120ad565b610708565b005b6102686107f1565b34801561027e57600080fd5b506000546102c79073ffffffffffffffffffffffffffffffffffffffff8116907401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1682565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff90911660208301520161019b565b34801561030c57600080fd5b5061026861031b3660046120ef565b610897565b61026861032e3660046121f7565b61094e565b34801561033f57600080fd5b5061023a61096d565b34801561035457600080fd5b5060015460025460035460045461038493929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff9182169284019290925216606082015260800161019b565b3480156103cc57600080fd5b506104096040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161019b91906122b5565b34801561042257600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b34801561047657600080fd5b506102686104853660046122e0565b61099c565b34801561049657600080fd5b50610445610b6c565b3480156104ab57600080fd5b506102686104ba366004612315565b610bd8565b3480156104cb57600080fd5b506102686104da366004612371565b610c27565b3480156104eb57600080fd5b506101e96104fa36600461238d565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561053357600080fd5b5061023a610dac565b34801561054857600080fd5b5061023a610e63565b34801561055d57600080fd5b506101e961056c366004612458565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b60007fb2e684be000000000000000000000000000000000000000000000000000000006106ac60608601866124d4565b6106b591612539565b7fffffffff0000000000000000000000000000000000000000000000000000000016036106e457506000610701565b6106ec610edf565b6106f68484610f80565b90506107018261104b565b9392505050565b6107106110b6565b60005b818110156107ec576107e48383838181106107305761073061259f565b905060200281019061074291906125ce565b61075090602081019061260c565b8484848181106107625761076261259f565b905060200281019061077491906125ce565b6020013585858581811061078a5761078a61259f565b905060200281019061079c91906125ce565b6107aa9060408101906124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b600101610713565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b5050505050565b61089f61120f565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561093257600080fd5b505af1158015610946573d6000803e3d6000fd5b505050505050565b6109566112b5565b61095f826113b9565b61096982826113c1565b5050565b60006109776114fa565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b426109ad610e106020840135612658565b1015610a1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20657870697265642070726f6f660000000000000060448201526064015b60405180910390fd5b604080516080810182526001548152600254602082015260035473ffffffffffffffffffffffffffffffffffffffff908116928201929092526004549091166060820152600090610a7390610a6e8461266b565b611569565b905080610adc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f66000000000000006044820152606401610a11565b6040518060400160405280836040013560001c73ffffffffffffffffffffffffffffffffffffffff1681526020016201518042610b1991906126ee565b6bffffffffffffffffffffffff908116909152815160209092015116740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff909116176000555050565b604080518082019091526000805473ffffffffffffffffffffffffffffffffffffffff811683527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208301819052909190421115610bd257600091505090565b51919050565b610be06110b6565b610c21848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061119292505050565b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610c725750825b905060008267ffffffffffffffff166001148015610c8f5750303b155b905081158015610c9d575080155b15610cd4576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610d355784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b856001610d428282612712565b505083156109465784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e91906127c6565b905090565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610e1d565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152606401610a11565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610ffb81610fc16101008701876124d4565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061185592505050565b73ffffffffffffffffffffffffffffffffffffffff16611019610b6c565b73ffffffffffffffffffffffffffffffffffffffff161461103e576001915050610676565b5060009392505050565b50565b80156110485760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610890576040519150601f19603f3d011682016040523d82523d6000602084013e610890565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061112c57506110fd610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152606401610a11565b6000808473ffffffffffffffffffffffffffffffffffffffff1684846040516111bb91906127df565b60006040518083038185875af1925050503d80600081146111f8576040519150601f19603f3d011682016040523d82523d6000602084013e6111fd565b606091505b50915091508161089057805160208201fd5b611217610b6c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061124f57503330145b610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152606401610a11565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061138257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166113697f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61104861120f565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611446575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611443918101906127c6565b60015b611494576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146114f0576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6107ec838361187f565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610f7e576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016115bb929190918252602082015260400190565b602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc91906127f1565b611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610a11565b600061167183604001516118e2565b80519091506003906000906116869083612658565b67ffffffffffffffff81111561169e5761169e61211b565b6040519080825280602002602001820160405280156116c7578160200160208202803683370190505b50865190915060009082826116db81612813565b9350815181106116ed576116ed61259f565b602002602001018181525050856020015160001b82828061170d90612813565b93508151811061171f5761171f61259f565b60209081029190910101526060860151828261173a81612813565b93508151811061174c5761174c61259f565b60200260200101818152505060005b84518110156117ae578481815181106117765761177661259f565b016020015160f81c838361178981612813565b94508151811061179b5761179b61259f565b602090810291909101015260010161175b565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e49161180991869060040161284b565b602060405180830381865afa158015611826573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184a91906127f1565b979650505050505050565b60008060008061186586866118ef565b925092509250611875828261193c565b5090949350505050565b61188882611a40565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156118da576107ec8282611b0f565b610969611b92565b6060610676826020611bca565b600080600083516041036119295760208401516040850151606086015160001a61191b88828585611d29565b955095509550505050611935565b50508151600091506002905b9250925092565b6000826003811115611950576119506128a5565b03611959575050565b600182600381111561196d5761196d6128a5565b036119a4576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156119b8576119b86128a5565b036119f2576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b6003826003811115611a0657611a066128a5565b03610969576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610a11565b8073ffffffffffffffffffffffffffffffffffffffff163b600003611aa9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610a11565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff1684604051611b3991906127df565b600060405180830381855af49150503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5091509150611b89858383611e23565b95945050505050565b3415610f7e576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060826000611bda8460026128d4565b67ffffffffffffffff811115611bf257611bf261211b565b6040519080825280601f01601f191660200182016040528015611c1c576020820181803683370190505b5090506000611c2c8560026128d4565b611c37906001612658565b90505b6001811115611cde577f303132333435363738396162636465660000000000000000000000000000000083600f1660108110611c7857611c7861259f565b1a60f81b82611c886002846128eb565b81518110611c9857611c9861259f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c91611cd7816128fe565b9050611c3a565b508115611d21576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610a11565b949350505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611d645750600091506003905082611e19565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015611db8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611e0f57506000925060019150829050611e19565b9250600091508190505b9450945094915050565b606082611e3857611e3382611eb2565b610701565b8151158015611e5c575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611eab576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610a11565b5080610701565b805115611ec25780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060208284031215611f0657600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461070157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461104857600080fd5b60008083601f840112611f6a57600080fd5b50813567ffffffffffffffff811115611f8257600080fd5b602083019150836020828501011115611f9a57600080fd5b9250929050565b600080600080600060808688031215611fb957600080fd5b8535611fc481611f36565b94506020860135611fd481611f36565b935060408601359250606086013567ffffffffffffffff811115611ff757600080fd5b61200388828901611f58565b969995985093965092949392505050565b60008060006060848603121561202957600080fd5b833567ffffffffffffffff81111561204057600080fd5b8401610120818703121561205357600080fd5b95602085013595506040909401359392505050565b60008083601f84011261207a57600080fd5b50813567ffffffffffffffff81111561209257600080fd5b6020830191508360208260051b8501011115611f9a57600080fd5b600080602083850312156120c057600080fd5b823567ffffffffffffffff8111156120d757600080fd5b6120e385828601612068565b90969095509350505050565b6000806040838503121561210257600080fd5b823561210d81611f36565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261215b57600080fd5b813567ffffffffffffffff8111156121755761217561211b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156121c2576121c261211b565b6040528181528382016020018510156121da57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561220a57600080fd5b823561221581611f36565b9150602083013567ffffffffffffffff81111561223157600080fd5b61223d8582860161214a565b9150509250929050565b60005b8381101561226257818101518382015260200161224a565b50506000910152565b60008151808452612283816020860160208601612247565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610701602083018461226b565b6000608082840312156122da57600080fd5b50919050565b6000602082840312156122f257600080fd5b813567ffffffffffffffff81111561230957600080fd5b611d21848285016122c8565b6000806000806060858703121561232b57600080fd5b843561233681611f36565b935060208501359250604085013567ffffffffffffffff81111561235957600080fd5b61236587828801611f58565b95989497509550505050565b60006080828403121561238357600080fd5b61070183836122c8565b60008060008060008060008060a0898b0312156123a957600080fd5b88356123b481611f36565b975060208901356123c481611f36565b9650604089013567ffffffffffffffff8111156123e057600080fd5b6123ec8b828c01612068565b909750955050606089013567ffffffffffffffff81111561240c57600080fd5b6124188b828c01612068565b909550935050608089013567ffffffffffffffff81111561243857600080fd5b6124448b828c01611f58565b999c989b5096995094979396929594505050565b60008060008060008060a0878903121561247157600080fd5b863561247c81611f36565b9550602087013561248c81611f36565b94506040870135935060608701359250608087013567ffffffffffffffff8111156124b657600080fd5b6124c289828a01611f58565b979a9699509497509295939492505050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261250957600080fd5b83018035915067ffffffffffffffff82111561252457600080fd5b602001915036819003821315611f9a57600080fd5b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015612598577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301811261260257600080fd5b9190910192915050565b60006020828403121561261e57600080fd5b813561070181611f36565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561067657610676612629565b60006080823603121561267d57600080fd5b6040516080810167ffffffffffffffff811182821017156126a0576126a061211b565b604052823567ffffffffffffffff8111156126ba57600080fd5b6126c63682860161214a565b8252506020838101359082015260408084013590820152606092830135928101929092525090565b6bffffffffffffffffffffffff818116838216019081111561067657610676612629565b8135815560208201356001820155604082013561272e81611f36565b6002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831617905550606082013561277f81611f36565b6003820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316179055505050565b6000602082840312156127d857600080fd5b5051919050565b60008251612602818460208701612247565b60006020828403121561280357600080fd5b8151801515811461070157600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361284457612844612629565b5060010190565b60408152600061285e604083018561226b565b828103602084015280845180835260208301915060208601925060005b8181101561289957835183526020938401939092019160010161287b565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b808202811582820484141761067657610676612629565b8181038181111561067657610676612629565b60008161290d5761290d612629565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212201713b23e80ac60dbf62058f5b0d11b6f5912c9a45cf6e3d29182f94852be320e64736f6c634300081b0033"; type SimpleAccountConstructorParams = | [signer?: Signer] diff --git a/packages/contracts/typechain-types/factories/contracts/TestJwtAccount__factory.ts b/packages/contracts/typechain-types/factories/contracts/TestJwtAccount__factory.ts index bddb40b..370b257 100644 --- a/packages/contracts/typechain-types/factories/contracts/TestJwtAccount__factory.ts +++ b/packages/contracts/typechain-types/factories/contracts/TestJwtAccount__factory.ts @@ -36,7 +36,7 @@ const _abi = [ type: "address", }, { - internalType: "contract UltraVerifier", + internalType: "contract HonkVerifier", name: "proofVerifier", type: "address", }, @@ -85,7 +85,7 @@ const _abi = [ type: "address", }, { - internalType: "contract UltraVerifier", + internalType: "contract HonkVerifier", name: "proofVerifier", type: "address", }, @@ -131,7 +131,7 @@ const _abi = [ ] as const; const _bytecode = - "0x608060405234801561001057600080fd5b50604051610adb380380610adb83398101604081905261002f91610093565b805160005560208101516001556040810151600280546001600160a01b03199081166001600160a01b0393841617909155606090920151600380549093169116179055610118565b80516001600160a01b038116811461008e57600080fd5b919050565b600060808284031280156100a657600080fd5b50604051600090608081016001600160401b03811182821017156100d857634e487b7160e01b83526041600452602483fd5b60409081528451825260208086015190830181905292506100fa908501610077565b604082015261010b60608501610077565b6060820152949350505050565b6109b4806101276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80637a28f8bc1461003b578063a8afd3e0146100a6575b600080fd5b60005460015460025460035461006a93929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff91821684840152166060830152519081900360800190f35b6100b96100b43660046105d9565b6100bb565b005b60408051608081018252600080548252600154602083015260025473ffffffffffffffffffffffffffffffffffffffff9081169383019390935260035490921660608201526101129061010d846106c2565b610184565b905080610180576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f660000000000000060448201526064015b60405180910390fd5b5050565b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016101d6929190918252602082015260400190565b602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610217919061079e565b61027d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610177565b600061028c8360400151610472565b80519091506003906000906102a190836107ef565b67ffffffffffffffff8111156102b9576102b961061b565b6040519080825280602002602001820160405280156102e2578160200160208202803683370190505b50865190915060009082826102f681610802565b9350815181106103085761030861083a565b602002602001018181525050856020015160001b82828061032890610802565b93508151811061033a5761033a61083a565b60209081029190910101526060860151828261035581610802565b9350815181106103675761036761083a565b60200260200101818152505060005b84518110156103c9578481815181106103915761039161083a565b016020015160f81c83836103a481610802565b9450815181106103b6576103b661083a565b6020908102919091010152600101610376565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e491610424918690600401610869565b602060405180830381865afa158015610441573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610465919061079e565b9450505050505b92915050565b606061046c826020606082600061048a84600261091f565b67ffffffffffffffff8111156104a2576104a261061b565b6040519080825280601f01601f1916602001820160405280156104cc576020820181803683370190505b50905060006104dc85600261091f565b6104e79060016107ef565b90505b600181111561058e577f303132333435363738396162636465660000000000000000000000000000000083600f16601081106105285761052861083a565b1a60f81b82610538600284610936565b815181106105485761054861083a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c9161058781610949565b90506104ea565b5081156105d1576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610177565b949350505050565b6000602082840312156105eb57600080fd5b813567ffffffffffffffff81111561060257600080fd5b82016080818503121561061457600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff8111828210171561066d5761066d61061b565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156106ba576106ba61061b565b604052919050565b6000608082360312156106d457600080fd5b6106dc61064a565b823567ffffffffffffffff8111156106f357600080fd5b830136601f82011261070457600080fd5b803567ffffffffffffffff81111561071e5761071e61061b565b61074f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610673565b81815236602083850101111561076457600080fd5b8160208401602083013760006020928201830152835284810135908301525060408084013590820152606092830135928101929092525090565b6000602082840312156107b057600080fd5b8151801515811461061457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561046c5761046c6107c0565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610833576108336107c0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b604081526000835180604084015260005b81811015610897576020818701810151606086840101520161087a565b506000606082850101527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f82011683019050606081016060848303016020850152808551808352608084019150602087019350600092505b8083101561091457835182526020820191506020840193506001830192506108f1565b509695505050505050565b808202811582820484141761046c5761046c6107c0565b8181038181111561046c5761046c6107c0565b600081610958576109586107c0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea26469706673582212206d4c2b9a151f2d8b54c6f4959be287757dc7da2161559f45e3c7c74bd70cb9e364736f6c634300081b0033"; + "0x608060405234801561001057600080fd5b50604051610adb380380610adb83398101604081905261002f91610093565b805160005560208101516001556040810151600280546001600160a01b03199081166001600160a01b0393841617909155606090920151600380549093169116179055610118565b80516001600160a01b038116811461008e57600080fd5b919050565b600060808284031280156100a657600080fd5b50604051600090608081016001600160401b03811182821017156100d857634e487b7160e01b83526041600452602483fd5b60409081528451825260208086015190830181905292506100fa908501610077565b604082015261010b60608501610077565b6060820152949350505050565b6109b4806101276000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80637a28f8bc1461003b578063a8afd3e0146100a6575b600080fd5b60005460015460025460035461006a93929173ffffffffffffffffffffffffffffffffffffffff908116911684565b60408051948552602085019390935273ffffffffffffffffffffffffffffffffffffffff91821684840152166060830152519081900360800190f35b6100b96100b43660046105d9565b6100bb565b005b60408051608081018252600080548252600154602083015260025473ffffffffffffffffffffffffffffffffffffffff9081169383019390935260035490921660608201526101129061010d846106c2565b610184565b905080610180576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4a77744163636f756e743a20696e76616c69642070726f6f660000000000000060448201526064015b60405180910390fd5b5050565b6000826040015173ffffffffffffffffffffffffffffffffffffffff16635879142a846020015184606001516040518363ffffffff1660e01b81526004016101d6929190918252602082015260400190565b602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610217919061079e565b61027d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f7075626c6963206b65792068617368206d69736d6174636800000000000000006044820152606401610177565b600061028c8360400151610472565b80519091506003906000906102a190836107ef565b67ffffffffffffffff8111156102b9576102b961061b565b6040519080825280602002602001820160405280156102e2578160200160208202803683370190505b50865190915060009082826102f681610802565b9350815181106103085761030861083a565b602002602001018181525050856020015160001b82828061032890610802565b93508151811061033a5761033a61083a565b60209081029190910101526060860151828261035581610802565b9350815181106103675761036761083a565b60200260200101818152505060005b84518110156103c9578481815181106103915761039161083a565b016020015160f81c83836103a481610802565b9450815181106103b6576103b661083a565b6020908102919091010152600101610376565b50606087015186516040517fea50d0e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163ea50d0e491610424918690600401610869565b602060405180830381865afa158015610441573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610465919061079e565b9450505050505b92915050565b606061046c826020606082600061048a84600261091f565b67ffffffffffffffff8111156104a2576104a261061b565b6040519080825280601f01601f1916602001820160405280156104cc576020820181803683370190505b50905060006104dc85600261091f565b6104e79060016107ef565b90505b600181111561058e577f303132333435363738396162636465660000000000000000000000000000000083600f16601081106105285761052861083a565b1a60f81b82610538600284610936565b815181106105485761054861083a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049290921c9161058781610949565b90506104ea565b5081156105d1576040517fe22e27eb0000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604401610177565b949350505050565b6000602082840312156105eb57600080fd5b813567ffffffffffffffff81111561060257600080fd5b82016080818503121561061457600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516080810167ffffffffffffffff8111828210171561066d5761066d61061b565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156106ba576106ba61061b565b604052919050565b6000608082360312156106d457600080fd5b6106dc61064a565b823567ffffffffffffffff8111156106f357600080fd5b830136601f82011261070457600080fd5b803567ffffffffffffffff81111561071e5761071e61061b565b61074f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610673565b81815236602083850101111561076457600080fd5b8160208401602083013760006020928201830152835284810135908301525060408084013590820152606092830135928101929092525090565b6000602082840312156107b057600080fd5b8151801515811461061457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561046c5761046c6107c0565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610833576108336107c0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b604081526000835180604084015260005b81811015610897576020818701810151606086840101520161087a565b506000606082850101527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f82011683019050606081016060848303016020850152808551808352608084019150602087019350600092505b8083101561091457835182526020820191506020840193506001830192506108f1565b509695505050505050565b808202811582820484141761046c5761046c6107c0565b8181038181111561046c5761046c6107c0565b600081610958576109586107c0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea264697066735822122091e46eaaacd5e37c87307f67341f74dce4ef5721d61bcb99bd6de8a021bf063064736f6c634300081b0033"; type TestJwtAccountConstructorParams = | [signer?: Signer] diff --git a/packages/contracts/typechain-types/factories/noir/target/index.ts b/packages/contracts/typechain-types/factories/noir/target/index.ts index 3dc5a3e..b34b5ae 100644 --- a/packages/contracts/typechain-types/factories/noir/target/index.ts +++ b/packages/contracts/typechain-types/factories/noir/target/index.ts @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f29c1d19b12884d0bde039cb701f2db09807091f39d867db3ed88a1dfe728e90 -size 142 +oid sha256:73f69e11b735eb41133f4ec4420146aa22905b8b983e976274778603dc39cd58 +size 203 diff --git a/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/HonkVerifier__factory.ts b/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/HonkVerifier__factory.ts new file mode 100644 index 0000000..269a7cb --- /dev/null +++ b/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/HonkVerifier__factory.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94894db4dec9ed59b4e091c54d4ee148fc408c9fc920355bd16a2ffd1e1c42c5 +size 51663 diff --git a/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/IVerifier__factory.ts b/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/IVerifier__factory.ts new file mode 100644 index 0000000..def878a --- /dev/null +++ b/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/IVerifier__factory.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03c582ec975777da11038a0d4b0b20753c7548f7b50a3f12a44c77a760086b62 +size 1044 diff --git a/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/index.ts b/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/index.ts new file mode 100644 index 0000000..1da2819 --- /dev/null +++ b/packages/contracts/typechain-types/factories/noir/target/jwt_account_honk.sol/index.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a36b035c5c58c16a68d9873443f91a4fc8d32cecbe42252cd3225b2229552925 +size 214 diff --git a/packages/contracts/typechain-types/hardhat.d.ts b/packages/contracts/typechain-types/hardhat.d.ts index 200e24a..a702ba0 100644 --- a/packages/contracts/typechain-types/hardhat.d.ts +++ b/packages/contracts/typechain-types/hardhat.d.ts @@ -137,6 +137,14 @@ declare module "hardhat/types/runtime" { name: "TestJwtAccount", signerOrOptions?: ethers.Signer | FactoryOptions ): Promise; + getContractFactory( + name: "HonkVerifier", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; + getContractFactory( + name: "IVerifier", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; getContractFactory( name: "BaseUltraVerifier", signerOrOptions?: ethers.Signer | FactoryOptions @@ -301,6 +309,16 @@ declare module "hardhat/types/runtime" { address: string | ethers.Addressable, signer?: ethers.Signer ): Promise; + getContractAt( + name: "HonkVerifier", + address: string | ethers.Addressable, + signer?: ethers.Signer + ): Promise; + getContractAt( + name: "IVerifier", + address: string | ethers.Addressable, + signer?: ethers.Signer + ): Promise; getContractAt( name: "BaseUltraVerifier", address: string | ethers.Addressable, @@ -436,6 +454,14 @@ declare module "hardhat/types/runtime" { name: "TestJwtAccount", signerOrOptions?: ethers.Signer | DeployContractOptions ): Promise; + deployContract( + name: "HonkVerifier", + signerOrOptions?: ethers.Signer | DeployContractOptions + ): Promise; + deployContract( + name: "IVerifier", + signerOrOptions?: ethers.Signer | DeployContractOptions + ): Promise; deployContract( name: "BaseUltraVerifier", signerOrOptions?: ethers.Signer | DeployContractOptions @@ -600,6 +626,16 @@ declare module "hardhat/types/runtime" { args: any[], signerOrOptions?: ethers.Signer | DeployContractOptions ): Promise; + deployContract( + name: "HonkVerifier", + args: any[], + signerOrOptions?: ethers.Signer | DeployContractOptions + ): Promise; + deployContract( + name: "IVerifier", + args: any[], + signerOrOptions?: ethers.Signer | DeployContractOptions + ): Promise; deployContract( name: "BaseUltraVerifier", args: any[], diff --git a/packages/contracts/typechain-types/index.ts b/packages/contracts/typechain-types/index.ts index c16bae7..510c317 100644 --- a/packages/contracts/typechain-types/index.ts +++ b/packages/contracts/typechain-types/index.ts @@ -70,6 +70,10 @@ export type { SimpleAccountFactory } from "./contracts/SimpleAccountFactory"; export { SimpleAccountFactory__factory } from "./factories/contracts/SimpleAccountFactory__factory"; export type { TestJwtAccount } from "./contracts/TestJwtAccount"; export { TestJwtAccount__factory } from "./factories/contracts/TestJwtAccount__factory"; +export type { HonkVerifier } from "./noir/target/jwt_account_honk.sol/HonkVerifier"; +export { HonkVerifier__factory } from "./factories/noir/target/jwt_account_honk.sol/HonkVerifier__factory"; +export type { IVerifier } from "./noir/target/jwt_account_honk.sol/IVerifier"; +export { IVerifier__factory } from "./factories/noir/target/jwt_account_honk.sol/IVerifier__factory"; export type { BaseUltraVerifier } from "./noir/target/jwt_account.sol/BaseUltraVerifier"; export { BaseUltraVerifier__factory } from "./factories/noir/target/jwt_account.sol/BaseUltraVerifier__factory"; export type { UltraVerifier } from "./noir/target/jwt_account.sol/UltraVerifier"; diff --git a/packages/contracts/typechain-types/noir/target/index.ts b/packages/contracts/typechain-types/noir/target/index.ts index 7dce216..7117083 100644 --- a/packages/contracts/typechain-types/noir/target/index.ts +++ b/packages/contracts/typechain-types/noir/target/index.ts @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc85d322f69930064f584e9993122c7ef2071f5db49f30ce0a9c5e7786ea8373 -size 178 +oid sha256:72e23482435a012b1b3ec9fb07ff0f7f19590f4d7dd1d7bb4ebdf488844a3b89 +size 279 diff --git a/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/HonkVerifier.ts b/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/HonkVerifier.ts new file mode 100644 index 0000000..d30c982 --- /dev/null +++ b/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/HonkVerifier.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:383aec9a0d92592f0285d6fec0acc68beb5bb2c222628efb0151b1c2cfc38751 +size 2530 diff --git a/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/IVerifier.ts b/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/IVerifier.ts new file mode 100644 index 0000000..9b7417d --- /dev/null +++ b/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/IVerifier.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c49b47abca6b1732132eba8c1286c3603a1d8ff00b8c79facfb0755d3878d113 +size 2522 diff --git a/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/index.ts b/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/index.ts new file mode 100644 index 0000000..9994090 --- /dev/null +++ b/packages/contracts/typechain-types/noir/target/jwt_account_honk.sol/index.ts @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb9f90f605d35a956ec0a4359e355b50167a142701b3fdfefbd19921d9beb3e1 +size 188