Contract Overview
Balance:
0 ETH
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0xdfd2eb6434afbb532c6c9eb594406a147fe81847459f9177f9e59b89b152ad6f | 0x60806040 | 7632837 | 173 days 8 hrs ago | 0x0d86b3e270a3d895cfb6620e5238fc83ac86b984 | IN | Create: SemaphoreVerifier | 0 ETH | 0.024791604983 |
[ Download CSV Export ]
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
SemaphoreVerifier
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./interfaces/ISemaphore.sol"; import "./interfaces/ISemaphoreVerifier.sol"; import "./base/SemaphoreGroups.sol"; /// @title Semaphore /// @dev This contract uses the Semaphore base contracts to provide a complete service /// to allow admins to create and manage groups and their members to generate Semaphore proofs /// and verify them. Group admins can add, update or remove group members, and can be /// an Ethereum account or a smart contract. This contract also assigns each new Merkle tree /// generated with a new root a duration (or an expiry) within which the proofs generated with that root /// can be validated. contract Semaphore is ISemaphore, SemaphoreGroups { ISemaphoreVerifier public verifier; /// @dev Gets a group id and returns the group parameters. mapping(uint256 => Group) public groups; /// @dev Checks if the group admin is the transaction sender. /// @param groupId: Id of the group. modifier onlyGroupAdmin(uint256 groupId) { if (groups[groupId].admin != _msgSender()) { revert Semaphore__CallerIsNotTheGroupAdmin(); } _; } /// @dev Checks if there is a verifier for the given tree depth. /// @param merkleTreeDepth: Depth of the tree. modifier onlySupportedMerkleTreeDepth(uint256 merkleTreeDepth) { if (merkleTreeDepth < 16 || merkleTreeDepth > 32) { revert Semaphore__MerkleTreeDepthIsNotSupported(); } _; } /// @dev Initializes the Semaphore verifier used to verify the user's ZK proofs. /// @param _verifier: Semaphore verifier address. constructor(ISemaphoreVerifier _verifier) { verifier = _verifier; } /// @dev See {ISemaphore-createGroup}. function createGroup( uint256 groupId, uint256 merkleTreeDepth, address admin ) external override onlySupportedMerkleTreeDepth(merkleTreeDepth) { _createGroup(groupId, merkleTreeDepth); groups[groupId].admin = admin; groups[groupId].merkleTreeDuration = 1 hours; emit GroupAdminUpdated(groupId, address(0), admin); } /// @dev See {ISemaphore-createGroup}. function createGroup( uint256 groupId, uint256 merkleTreeDepth, address admin, uint256 merkleTreeDuration ) external override onlySupportedMerkleTreeDepth(merkleTreeDepth) { _createGroup(groupId, merkleTreeDepth); groups[groupId].admin = admin; groups[groupId].merkleTreeDuration = merkleTreeDuration; emit GroupAdminUpdated(groupId, address(0), admin); } /// @dev See {ISemaphore-updateGroupAdmin}. function updateGroupAdmin(uint256 groupId, address newAdmin) external override onlyGroupAdmin(groupId) { groups[groupId].admin = newAdmin; emit GroupAdminUpdated(groupId, _msgSender(), newAdmin); } /// @dev See {ISemaphore-updateGroupMerkleTreeDuration}. function updateGroupMerkleTreeDuration( uint256 groupId, uint256 newMerkleTreeDuration ) external override onlyGroupAdmin(groupId) { uint256 oldMerkleTreeDuration = groups[groupId].merkleTreeDuration; groups[groupId].merkleTreeDuration = newMerkleTreeDuration; emit GroupMerkleTreeDurationUpdated(groupId, oldMerkleTreeDuration, newMerkleTreeDuration); } /// @dev See {ISemaphore-addMember}. function addMember(uint256 groupId, uint256 identityCommitment) external override onlyGroupAdmin(groupId) { _addMember(groupId, identityCommitment); uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); groups[groupId].merkleRootCreationDates[merkleTreeRoot] = block.timestamp; } /// @dev See {ISemaphore-addMembers}. function addMembers( uint256 groupId, uint256[] calldata identityCommitments ) external override onlyGroupAdmin(groupId) { for (uint256 i = 0; i < identityCommitments.length; ) { _addMember(groupId, identityCommitments[i]); unchecked { ++i; } } uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); groups[groupId].merkleRootCreationDates[merkleTreeRoot] = block.timestamp; } /// @dev See {ISemaphore-updateMember}. function updateMember( uint256 groupId, uint256 identityCommitment, uint256 newIdentityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external override onlyGroupAdmin(groupId) { _updateMember(groupId, identityCommitment, newIdentityCommitment, proofSiblings, proofPathIndices); uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); groups[groupId].merkleRootCreationDates[merkleTreeRoot] = block.timestamp; } /// @dev See {ISemaphore-removeMember}. function removeMember( uint256 groupId, uint256 identityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external override onlyGroupAdmin(groupId) { _removeMember(groupId, identityCommitment, proofSiblings, proofPathIndices); uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); groups[groupId].merkleRootCreationDates[merkleTreeRoot] = block.timestamp; } /// @dev See {ISemaphore-verifyProof}. function verifyProof( uint256 groupId, uint256 merkleTreeRoot, uint256 signal, uint256 nullifierHash, uint256 externalNullifier, uint256[8] calldata proof ) external override { uint256 merkleTreeDepth = getMerkleTreeDepth(groupId); if (merkleTreeDepth == 0) { revert Semaphore__GroupDoesNotExist(); } uint256 currentMerkleTreeRoot = getMerkleTreeRoot(groupId); // A proof could have used an old Merkle tree root. // https://github.com/semaphore-protocol/semaphore/issues/98 if (merkleTreeRoot != currentMerkleTreeRoot) { uint256 merkleRootCreationDate = groups[groupId].merkleRootCreationDates[merkleTreeRoot]; uint256 merkleTreeDuration = groups[groupId].merkleTreeDuration; if (merkleRootCreationDate == 0) { revert Semaphore__MerkleTreeRootIsNotPartOfTheGroup(); } if (block.timestamp > merkleRootCreationDate + merkleTreeDuration) { revert Semaphore__MerkleTreeRootIsExpired(); } } if (groups[groupId].nullifierHashes[nullifierHash]) { revert Semaphore__YouAreUsingTheSameNillifierTwice(); } verifier.verifyProof(merkleTreeRoot, nullifierHash, signal, externalNullifier, proof, merkleTreeDepth); groups[groupId].nullifierHashes[nullifierHash] = true; emit ProofVerified(groupId, merkleTreeRoot, nullifierHash, externalNullifier, signal); } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; /// @title Semaphore contract interface. interface ISemaphore { error Semaphore__CallerIsNotTheGroupAdmin(); error Semaphore__MerkleTreeDepthIsNotSupported(); error Semaphore__MerkleTreeRootIsExpired(); error Semaphore__MerkleTreeRootIsNotPartOfTheGroup(); error Semaphore__YouAreUsingTheSameNillifierTwice(); /// It defines all the group parameters, in addition to those in the Merkle tree. struct Group { address admin; uint256 merkleTreeDuration; mapping(uint256 => uint256) merkleRootCreationDates; mapping(uint256 => bool) nullifierHashes; } /// @dev Emitted when an admin is assigned to a group. /// @param groupId: Id of the group. /// @param oldAdmin: Old admin of the group. /// @param newAdmin: New admin of the group. event GroupAdminUpdated(uint256 indexed groupId, address indexed oldAdmin, address indexed newAdmin); /// @dev Emitted when the Merkle tree duration of a group is updated. /// @param groupId: Id of the group. /// @param oldMerkleTreeDuration: Old Merkle tree duration of the group. /// @param newMerkleTreeDuration: New Merkle tree duration of the group. event GroupMerkleTreeDurationUpdated( uint256 indexed groupId, uint256 oldMerkleTreeDuration, uint256 newMerkleTreeDuration ); /// @dev Emitted when a Semaphore proof is verified. /// @param groupId: Id of the group. /// @param merkleTreeRoot: Root of the Merkle tree. /// @param nullifierHash: Nullifier hash. /// @param externalNullifier: External nullifier. /// @param signal: Semaphore signal. event ProofVerified( uint256 indexed groupId, uint256 indexed merkleTreeRoot, uint256 nullifierHash, uint256 indexed externalNullifier, uint256 signal ); /// @dev Saves the nullifier hash to avoid double signaling and emits an event /// if the zero-knowledge proof is valid. /// @param groupId: Id of the group. /// @param merkleTreeRoot: Root of the Merkle tree. /// @param signal: Semaphore signal. /// @param nullifierHash: Nullifier hash. /// @param externalNullifier: External nullifier. /// @param proof: Zero-knowledge proof. function verifyProof( uint256 groupId, uint256 merkleTreeRoot, uint256 signal, uint256 nullifierHash, uint256 externalNullifier, uint256[8] calldata proof ) external; /// @dev Creates a new group. Only the admin will be able to add or remove members. /// @param groupId: Id of the group. /// @param depth: Depth of the tree. /// @param admin: Admin of the group. function createGroup(uint256 groupId, uint256 depth, address admin) external; /// @dev Creates a new group. Only the admin will be able to add or remove members. /// @param groupId: Id of the group. /// @param depth: Depth of the tree. /// @param admin: Admin of the group. /// @param merkleTreeRootDuration: Time before the validity of a root expires. function createGroup(uint256 groupId, uint256 depth, address admin, uint256 merkleTreeRootDuration) external; /// @dev Updates the group admin. /// @param groupId: Id of the group. /// @param newAdmin: New admin of the group. function updateGroupAdmin(uint256 groupId, address newAdmin) external; /// @dev Updates the group Merkle tree duration. /// @param groupId: Id of the group. /// @param newMerkleTreeDuration: New Merkle tree duration. function updateGroupMerkleTreeDuration(uint256 groupId, uint256 newMerkleTreeDuration) external; /// @dev Adds a new member to an existing group. /// @param groupId: Id of the group. /// @param identityCommitment: New identity commitment. function addMember(uint256 groupId, uint256 identityCommitment) external; /// @dev Adds new members to an existing group. /// @param groupId: Id of the group. /// @param identityCommitments: New identity commitments. function addMembers(uint256 groupId, uint256[] calldata identityCommitments) external; /// @dev Updates an identity commitment of an existing group. A proof of membership is /// needed to check if the node to be updated is part of the tree. /// @param groupId: Id of the group. /// @param identityCommitment: Existing identity commitment to be updated. /// @param newIdentityCommitment: New identity commitment. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function updateMember( uint256 groupId, uint256 identityCommitment, uint256 newIdentityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external; /// @dev Removes a member from an existing group. A proof of membership is /// needed to check if the node to be removed is part of the tree. /// @param groupId: Id of the group. /// @param identityCommitment: Identity commitment to be removed. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function removeMember( uint256 groupId, uint256 identityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "../base/Pairing.sol"; /// @title SemaphoreVerifier contract interface. interface ISemaphoreVerifier { struct VerificationKey { Pairing.G1Point alfa1; Pairing.G2Point beta2; Pairing.G2Point gamma2; Pairing.G2Point delta2; Pairing.G1Point[] IC; } struct Proof { Pairing.G1Point A; Pairing.G2Point B; Pairing.G1Point C; } /// @dev Verifies whether a Semaphore proof is valid. /// @param merkleTreeRoot: Root of the Merkle tree. /// @param nullifierHash: Nullifier hash. /// @param signal: Semaphore signal. /// @param externalNullifier: External nullifier. /// @param proof: Zero-knowledge proof. /// @param merkleTreeDepth: Depth of the tree. function verifyProof( uint256 merkleTreeRoot, uint256 nullifierHash, uint256 signal, uint256 externalNullifier, uint256[8] calldata proof, uint256 merkleTreeDepth ) external view; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "../interfaces/ISemaphoreGroups.sol"; import "@zk-kit/incremental-merkle-tree.sol/IncrementalBinaryTree.sol"; import "@openzeppelin/contracts/utils/Context.sol"; /// @title Semaphore groups contract. /// @dev This contract allows you to create groups, add, remove and update members. /// You can use getters to obtain informations about groups (root, depth, number of leaves). abstract contract SemaphoreGroups is Context, ISemaphoreGroups { using IncrementalBinaryTree for IncrementalTreeData; /// @dev Gets a group id and returns the tree data. mapping(uint256 => IncrementalTreeData) internal merkleTrees; /// @dev Creates a new group by initializing the associated tree. /// @param groupId: Id of the group. /// @param merkleTreeDepth: Depth of the tree. function _createGroup(uint256 groupId, uint256 merkleTreeDepth) internal virtual { if (getMerkleTreeDepth(groupId) != 0) { revert Semaphore__GroupAlreadyExists(); } // The zeroValue is an implicit member of the group, or an implicit leaf of the Merkle tree. // Although there is a remote possibility that the preimage of // the hash may be calculated, using this value we aim to minimize the risk. uint256 zeroValue = uint256(keccak256(abi.encodePacked(groupId))) >> 8; merkleTrees[groupId].init(merkleTreeDepth, zeroValue); emit GroupCreated(groupId, merkleTreeDepth, zeroValue); } /// @dev Adds an identity commitment to an existing group. /// @param groupId: Id of the group. /// @param identityCommitment: New identity commitment. function _addMember(uint256 groupId, uint256 identityCommitment) internal virtual { if (getMerkleTreeDepth(groupId) == 0) { revert Semaphore__GroupDoesNotExist(); } merkleTrees[groupId].insert(identityCommitment); uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); uint256 index = getNumberOfMerkleTreeLeaves(groupId) - 1; emit MemberAdded(groupId, index, identityCommitment, merkleTreeRoot); } /// @dev Updates an identity commitment of an existing group. A proof of membership is /// needed to check if the node to be updated is part of the tree. /// @param groupId: Id of the group. /// @param identityCommitment: Existing identity commitment to be updated. /// @param newIdentityCommitment: New identity commitment. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function _updateMember( uint256 groupId, uint256 identityCommitment, uint256 newIdentityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) internal virtual { if (getMerkleTreeDepth(groupId) == 0) { revert Semaphore__GroupDoesNotExist(); } merkleTrees[groupId].update(identityCommitment, newIdentityCommitment, proofSiblings, proofPathIndices); uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); uint256 index = proofPathIndicesToMemberIndex(proofPathIndices); emit MemberUpdated(groupId, index, identityCommitment, newIdentityCommitment, merkleTreeRoot); } /// @dev Removes an identity commitment from an existing group. A proof of membership is /// needed to check if the node to be deleted is part of the tree. /// @param groupId: Id of the group. /// @param identityCommitment: Existing identity commitment to be removed. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function _removeMember( uint256 groupId, uint256 identityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) internal virtual { if (getMerkleTreeDepth(groupId) == 0) { revert Semaphore__GroupDoesNotExist(); } merkleTrees[groupId].remove(identityCommitment, proofSiblings, proofPathIndices); uint256 merkleTreeRoot = getMerkleTreeRoot(groupId); uint256 index = proofPathIndicesToMemberIndex(proofPathIndices); emit MemberRemoved(groupId, index, identityCommitment, merkleTreeRoot); } /// @dev See {ISemaphoreGroups-getMerkleTreeRoot}. function getMerkleTreeRoot(uint256 groupId) public view virtual override returns (uint256) { return merkleTrees[groupId].root; } /// @dev See {ISemaphoreGroups-getMerkleTreeDepth}. function getMerkleTreeDepth(uint256 groupId) public view virtual override returns (uint256) { return merkleTrees[groupId].depth; } /// @dev See {ISemaphoreGroups-getNumberOfMerkleTreeLeaves}. function getNumberOfMerkleTreeLeaves(uint256 groupId) public view virtual override returns (uint256) { return merkleTrees[groupId].numberOfLeaves; } /// @dev Converts the path indices of a Merkle proof to the identity commitment index in the tree. /// @param proofPathIndices: Path of the proof of membership. /// @return Index of a group member. function proofPathIndicesToMemberIndex(uint8[] calldata proofPathIndices) private pure returns (uint256) { uint256 memberIndex = 0; for (uint8 i = uint8(proofPathIndices.length); i > 0; ) { if (memberIndex > 0 || proofPathIndices[i - 1] != 0) { memberIndex *= 2; if (proofPathIndices[i - 1] == 1) { memberIndex += 1; } } unchecked { --i; } } return memberIndex; } }
// Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // The following Pairing library is a modified version adapted to Semaphore. // // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library Pairing { error InvalidProof(); // The prime q in the base field F_q for G1 uint256 constant BASE_MODULUS = 21888242871839275222246405745257275088696311157297823662689037894645226208583; // The prime modulus of the scalar field of G1. uint256 constant SCALAR_MODULUS = 21888242871839275222246405745257275088548364400416034343698204186575808495617; struct G1Point { uint256 X; uint256 Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint256[2] X; uint256[2] Y; } /// @return the generator of G1 function P1() public pure returns (G1Point memory) { return G1Point(1, 2); } /// @return the generator of G2 function P2() public pure returns (G2Point memory) { return G2Point( [ 11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781 ], [ 4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930 ] ); } /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) public pure returns (G1Point memory r) { if (p.X == 0 && p.Y == 0) { return G1Point(0, 0); } // Validate input or revert if (p.X >= BASE_MODULUS || p.Y >= BASE_MODULUS) { revert InvalidProof(); } // We know p.Y > 0 and p.Y < BASE_MODULUS. return G1Point(p.X, BASE_MODULUS - p.Y); } /// @return r the sum of two points of G1 function addition(G1Point memory p1, G1Point memory p2) public view returns (G1Point memory r) { // By EIP-196 all input is validated to be less than the BASE_MODULUS and form points // on the curve. uint256[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) } if (!success) { revert InvalidProof(); } } /// @return r the product of a point on G1 and a scalar, i.e. /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. function scalar_mul(G1Point memory p, uint256 s) public view returns (G1Point memory r) { // By EIP-196 the values p.X and p.Y are verified to be less than the BASE_MODULUS and // form a valid point on the curve. But the scalar is not verified, so we do that explicitly. if (s >= SCALAR_MODULUS) { revert InvalidProof(); } uint256[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) } if (!success) { revert InvalidProof(); } } /// Asserts the pairing check /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should succeed function pairingCheck(G1Point[] memory p1, G2Point[] memory p2) public view { // By EIP-197 all input is verified to be less than the BASE_MODULUS and form elements in their // respective groups of the right order. if (p1.length != p2.length) { revert InvalidProof(); } uint256 elements = p1.length; uint256 inputSize = elements * 6; uint256[] memory input = new uint256[](inputSize); for (uint256 i = 0; i < elements; i++) { input[i * 6 + 0] = p1[i].X; input[i * 6 + 1] = p1[i].Y; input[i * 6 + 2] = p2[i].X[0]; input[i * 6 + 3] = p2[i].X[1]; input[i * 6 + 4] = p2[i].Y[0]; input[i * 6 + 5] = p2[i].Y[1]; } uint256[1] memory out; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20) } if (!success || out[0] != 1) { revert InvalidProof(); } } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; /// @title SemaphoreGroups contract interface. interface ISemaphoreGroups { error Semaphore__GroupDoesNotExist(); error Semaphore__GroupAlreadyExists(); /// @dev Emitted when a new group is created. /// @param groupId: Id of the group. /// @param merkleTreeDepth: Depth of the tree. /// @param zeroValue: Zero value of the tree. event GroupCreated(uint256 indexed groupId, uint256 merkleTreeDepth, uint256 zeroValue); /// @dev Emitted when a new identity commitment is added. /// @param groupId: Group id of the group. /// @param index: Identity commitment index. /// @param identityCommitment: New identity commitment. /// @param merkleTreeRoot: New root hash of the tree. event MemberAdded(uint256 indexed groupId, uint256 index, uint256 identityCommitment, uint256 merkleTreeRoot); /// @dev Emitted when an identity commitment is updated. /// @param groupId: Group id of the group. /// @param index: Identity commitment index. /// @param identityCommitment: Existing identity commitment to be updated. /// @param newIdentityCommitment: New identity commitment. /// @param merkleTreeRoot: New root hash of the tree. event MemberUpdated( uint256 indexed groupId, uint256 index, uint256 identityCommitment, uint256 newIdentityCommitment, uint256 merkleTreeRoot ); /// @dev Emitted when a new identity commitment is removed. /// @param groupId: Group id of the group. /// @param index: Identity commitment index. /// @param identityCommitment: Existing identity commitment to be removed. /// @param merkleTreeRoot: New root hash of the tree. event MemberRemoved(uint256 indexed groupId, uint256 index, uint256 identityCommitment, uint256 merkleTreeRoot); /// @dev Returns the last root hash of a group. /// @param groupId: Id of the group. /// @return Root hash of the group. function getMerkleTreeRoot(uint256 groupId) external view returns (uint256); /// @dev Returns the depth of the tree of a group. /// @param groupId: Id of the group. /// @return Depth of the group tree. function getMerkleTreeDepth(uint256 groupId) external view returns (uint256); /// @dev Returns the number of tree leaves of a group. /// @param groupId: Id of the group. /// @return Number of tree leaves. function getNumberOfMerkleTreeLeaves(uint256 groupId) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {PoseidonT3} from "./Hashes.sol"; // Each incremental tree has certain properties and data that will // be used to add new leaves. struct IncrementalTreeData { uint256 depth; // Depth of the tree (levels - 1). uint256 root; // Root hash of the tree. uint256 numberOfLeaves; // Number of leaves of the tree. mapping(uint256 => uint256) zeroes; // Zero hashes used for empty nodes (level -> zero hash). // The nodes of the subtrees used in the last addition of a leaf (level -> [left node, right node]). mapping(uint256 => uint256[2]) lastSubtrees; // Caching these values is essential to efficient appends. } /// @title Incremental binary Merkle tree. /// @dev The incremental tree allows to calculate the root hash each time a leaf is added, ensuring /// the integrity of the tree. library IncrementalBinaryTree { uint8 internal constant MAX_DEPTH = 32; uint256 internal constant SNARK_SCALAR_FIELD = 21888242871839275222246405745257275088548364400416034343698204186575808495617; /// @dev Initializes a tree. /// @param self: Tree data. /// @param depth: Depth of the tree. /// @param zero: Zero value to be used. function init( IncrementalTreeData storage self, uint256 depth, uint256 zero ) public { require(zero < SNARK_SCALAR_FIELD, "IncrementalBinaryTree: leaf must be < SNARK_SCALAR_FIELD"); require(depth > 0 && depth <= MAX_DEPTH, "IncrementalBinaryTree: tree depth must be between 1 and 32"); self.depth = depth; for (uint8 i = 0; i < depth; ) { self.zeroes[i] = zero; zero = PoseidonT3.poseidon([zero, zero]); unchecked { ++i; } } self.root = zero; } /// @dev Inserts a leaf in the tree. /// @param self: Tree data. /// @param leaf: Leaf to be inserted. function insert(IncrementalTreeData storage self, uint256 leaf) public { uint256 depth = self.depth; require(leaf < SNARK_SCALAR_FIELD, "IncrementalBinaryTree: leaf must be < SNARK_SCALAR_FIELD"); require(self.numberOfLeaves < 2**depth, "IncrementalBinaryTree: tree is full"); uint256 index = self.numberOfLeaves; uint256 hash = leaf; for (uint8 i = 0; i < depth; ) { if (index & 1 == 0) { self.lastSubtrees[i] = [hash, self.zeroes[i]]; } else { self.lastSubtrees[i][1] = hash; } hash = PoseidonT3.poseidon(self.lastSubtrees[i]); index >>= 1; unchecked { ++i; } } self.root = hash; self.numberOfLeaves += 1; } /// @dev Updates a leaf in the tree. /// @param self: Tree data. /// @param leaf: Leaf to be updated. /// @param newLeaf: New leaf. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function update( IncrementalTreeData storage self, uint256 leaf, uint256 newLeaf, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) public { require(newLeaf != leaf, "IncrementalBinaryTree: new leaf cannot be the same as the old one"); require(newLeaf < SNARK_SCALAR_FIELD, "IncrementalBinaryTree: new leaf must be < SNARK_SCALAR_FIELD"); require( verify(self, leaf, proofSiblings, proofPathIndices), "IncrementalBinaryTree: leaf is not part of the tree" ); uint256 depth = self.depth; uint256 hash = newLeaf; uint256 updateIndex; for (uint8 i = 0; i < depth; ) { updateIndex |= uint256(proofPathIndices[i]) << uint256(i); if (proofPathIndices[i] == 0) { if (proofSiblings[i] == self.lastSubtrees[i][1]) { self.lastSubtrees[i][0] = hash; } hash = PoseidonT3.poseidon([hash, proofSiblings[i]]); } else { if (proofSiblings[i] == self.lastSubtrees[i][0]) { self.lastSubtrees[i][1] = hash; } hash = PoseidonT3.poseidon([proofSiblings[i], hash]); } unchecked { ++i; } } require(updateIndex < self.numberOfLeaves, "IncrementalBinaryTree: leaf index out of range"); self.root = hash; } /// @dev Removes a leaf from the tree. /// @param self: Tree data. /// @param leaf: Leaf to be removed. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function remove( IncrementalTreeData storage self, uint256 leaf, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) public { update(self, leaf, self.zeroes[0], proofSiblings, proofPathIndices); } /// @dev Verify if the path is correct and the leaf is part of the tree. /// @param self: Tree data. /// @param leaf: Leaf to be removed. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. /// @return True or false. function verify( IncrementalTreeData storage self, uint256 leaf, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) private view returns (bool) { require(leaf < SNARK_SCALAR_FIELD, "IncrementalBinaryTree: leaf must be < SNARK_SCALAR_FIELD"); uint256 depth = self.depth; require( proofPathIndices.length == depth && proofSiblings.length == depth, "IncrementalBinaryTree: length of path is not correct" ); uint256 hash = leaf; for (uint8 i = 0; i < depth; ) { require( proofSiblings[i] < SNARK_SCALAR_FIELD, "IncrementalBinaryTree: sibling node must be < SNARK_SCALAR_FIELD" ); require( proofPathIndices[i] == 1 || proofPathIndices[i] == 0, "IncrementalBinaryTree: path index is neither 0 nor 1" ); if (proofPathIndices[i] == 0) { hash = PoseidonT3.poseidon([hash, proofSiblings[i]]); } else { hash = PoseidonT3.poseidon([proofSiblings[i], hash]); } unchecked { ++i; } } return hash == self.root; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library PoseidonT3 { function poseidon(uint256[2] memory) public pure returns (uint256) {} } library PoseidonT6 { function poseidon(uint256[5] memory) public pure returns (uint256) {} }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "../interfaces/ISemaphoreWhistleblowing.sol"; import "../interfaces/ISemaphoreVerifier.sol"; import "../base/SemaphoreGroups.sol"; /// @title Semaphore whistleblowing contract. /// @notice It allows users to leak information anonymously . /// @dev The following code allows you to create entities for whistleblowers (e.g. non-profit /// organization, newspaper) and allow them to leak anonymously. /// Leaks can be IPFS hashes, permanent links or other kinds of references. contract SemaphoreWhistleblowing is ISemaphoreWhistleblowing, SemaphoreGroups { ISemaphoreVerifier public verifier; /// @dev Gets an entity id and return its editor address. mapping(uint256 => address) private entities; /// @dev Checks if the editor is the transaction sender. /// @param entityId: Id of the entity. modifier onlyEditor(uint256 entityId) { if (entities[entityId] != _msgSender()) { revert Semaphore__CallerIsNotTheEditor(); } _; } /// @dev Initializes the Semaphore verifier used to verify the user's ZK proofs. /// @param _verifier: Semaphore verifier address. constructor(ISemaphoreVerifier _verifier) { verifier = _verifier; } /// @dev See {ISemaphoreWhistleblowing-createEntity}. function createEntity(uint256 entityId, address editor, uint256 merkleTreeDepth) public override { if (merkleTreeDepth < 16 || merkleTreeDepth > 32) { revert Semaphore__MerkleTreeDepthIsNotSupported(); } _createGroup(entityId, merkleTreeDepth); entities[entityId] = editor; emit EntityCreated(entityId, editor); } /// @dev See {ISemaphoreWhistleblowing-addWhistleblower}. function addWhistleblower(uint256 entityId, uint256 identityCommitment) public override onlyEditor(entityId) { _addMember(entityId, identityCommitment); } /// @dev See {ISemaphoreWhistleblowing-removeWhistleblower}. function removeWhistleblower( uint256 entityId, uint256 identityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) public override onlyEditor(entityId) { _removeMember(entityId, identityCommitment, proofSiblings, proofPathIndices); } /// @dev See {ISemaphoreWhistleblowing-publishLeak}. function publishLeak( uint256 leak, uint256 nullifierHash, uint256 entityId, uint256[8] calldata proof ) public override { uint256 merkleTreeDepth = getMerkleTreeDepth(entityId); uint256 merkleTreeRoot = getMerkleTreeRoot(entityId); verifier.verifyProof(merkleTreeRoot, nullifierHash, leak, entityId, proof, merkleTreeDepth); emit LeakPublished(entityId, leak); } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; /// @title SemaphoreWhistleblowing contract interface. interface ISemaphoreWhistleblowing { error Semaphore__CallerIsNotTheEditor(); error Semaphore__MerkleTreeDepthIsNotSupported(); struct Verifier { address contractAddress; uint256 merkleTreeDepth; } /// @dev Emitted when a new entity is created. /// @param entityId: Id of the entity. /// @param editor: Editor of the entity. event EntityCreated(uint256 entityId, address indexed editor); /// @dev Emitted when a whistleblower publish a new leak. /// @param entityId: Id of the entity. /// @param leak: News leak. event LeakPublished(uint256 indexed entityId, uint256 leak); /// @dev Creates an entity and the associated Merkle tree/group. /// @param entityId: Id of the entity. /// @param editor: Editor of the entity. /// @param merkleTreeDepth: Depth of the tree. function createEntity(uint256 entityId, address editor, uint256 merkleTreeDepth) external; /// @dev Adds a whistleblower to an entity. /// @param entityId: Id of the entity. /// @param identityCommitment: Identity commitment of the group member. function addWhistleblower(uint256 entityId, uint256 identityCommitment) external; /// @dev Removes a whistleblower from an entity. /// @param entityId: Id of the entity. /// @param identityCommitment: Identity commitment of the group member. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function removeWhistleblower( uint256 entityId, uint256 identityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external; /// @dev Allows whistleblowers to publish leaks anonymously. /// @param leak: News leak. /// @param nullifierHash: Nullifier hash. /// @param entityId: Id of the entity. /// @param proof: Private zk-proof parameters. function publishLeak(uint256 leak, uint256 nullifierHash, uint256 entityId, uint256[8] calldata proof) external; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "../interfaces/ISemaphoreVoting.sol"; import "../interfaces/ISemaphoreVerifier.sol"; import "../base/SemaphoreGroups.sol"; /// @title Semaphore voting contract. /// @notice It allows users to vote anonymously in a poll. /// @dev The following code allows you to create polls, add voters and allow them to vote anonymously. contract SemaphoreVoting is ISemaphoreVoting, SemaphoreGroups { ISemaphoreVerifier public verifier; /// @dev Gets a poll id and returns the poll data. mapping(uint256 => Poll) internal polls; /// @dev Checks if the poll coordinator is the transaction sender. /// @param pollId: Id of the poll. modifier onlyCoordinator(uint256 pollId) { if (polls[pollId].coordinator != _msgSender()) { revert Semaphore__CallerIsNotThePollCoordinator(); } _; } /// @dev Initializes the Semaphore verifier used to verify the user's ZK proofs. /// @param _verifier: Semaphore verifier address. constructor(ISemaphoreVerifier _verifier) { verifier = _verifier; } /// @dev See {ISemaphoreVoting-createPoll}. function createPoll(uint256 pollId, address coordinator, uint256 merkleTreeDepth) public override { if (merkleTreeDepth < 16 || merkleTreeDepth > 32) { revert Semaphore__MerkleTreeDepthIsNotSupported(); } _createGroup(pollId, merkleTreeDepth); polls[pollId].coordinator = coordinator; emit PollCreated(pollId, coordinator); } /// @dev See {ISemaphoreVoting-addVoter}. function addVoter(uint256 pollId, uint256 identityCommitment) public override onlyCoordinator(pollId) { if (polls[pollId].state != PollState.Created) { revert Semaphore__PollHasAlreadyBeenStarted(); } _addMember(pollId, identityCommitment); } /// @dev See {ISemaphoreVoting-addVoter}. function startPoll(uint256 pollId, uint256 encryptionKey) public override onlyCoordinator(pollId) { if (polls[pollId].state != PollState.Created) { revert Semaphore__PollHasAlreadyBeenStarted(); } polls[pollId].state = PollState.Ongoing; emit PollStarted(pollId, _msgSender(), encryptionKey); } /// @dev See {ISemaphoreVoting-castVote}. function castVote(uint256 vote, uint256 nullifierHash, uint256 pollId, uint256[8] calldata proof) public override { if (polls[pollId].state != PollState.Ongoing) { revert Semaphore__PollIsNotOngoing(); } if (polls[pollId].nullifierHashes[nullifierHash]) { revert Semaphore__YouAreUsingTheSameNillifierTwice(); } uint256 merkleTreeDepth = getMerkleTreeDepth(pollId); uint256 merkleTreeRoot = getMerkleTreeRoot(pollId); verifier.verifyProof(merkleTreeRoot, nullifierHash, vote, pollId, proof, merkleTreeDepth); polls[pollId].nullifierHashes[nullifierHash] = true; emit VoteAdded(pollId, vote); } /// @dev See {ISemaphoreVoting-publishDecryptionKey}. function endPoll(uint256 pollId, uint256 decryptionKey) public override onlyCoordinator(pollId) { if (polls[pollId].state != PollState.Ongoing) { revert Semaphore__PollIsNotOngoing(); } polls[pollId].state = PollState.Ended; emit PollEnded(pollId, _msgSender(), decryptionKey); } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; /// @title SemaphoreVoting contract interface. interface ISemaphoreVoting { error Semaphore__CallerIsNotThePollCoordinator(); error Semaphore__MerkleTreeDepthIsNotSupported(); error Semaphore__PollHasAlreadyBeenStarted(); error Semaphore__PollIsNotOngoing(); error Semaphore__YouAreUsingTheSameNillifierTwice(); enum PollState { Created, Ongoing, Ended } struct Verifier { address contractAddress; uint256 merkleTreeDepth; } struct Poll { address coordinator; PollState state; mapping(uint256 => bool) nullifierHashes; } /// @dev Emitted when a new poll is created. /// @param pollId: Id of the poll. /// @param coordinator: Coordinator of the poll. event PollCreated(uint256 pollId, address indexed coordinator); /// @dev Emitted when a poll is started. /// @param pollId: Id of the poll. /// @param coordinator: Coordinator of the poll. /// @param encryptionKey: Key to encrypt the poll votes. event PollStarted(uint256 pollId, address indexed coordinator, uint256 encryptionKey); /// @dev Emitted when a user votes on a poll. /// @param pollId: Id of the poll. /// @param vote: User encrypted vote. event VoteAdded(uint256 indexed pollId, uint256 vote); /// @dev Emitted when a poll is ended. /// @param pollId: Id of the poll. /// @param coordinator: Coordinator of the poll. /// @param decryptionKey: Key to decrypt the poll votes. event PollEnded(uint256 pollId, address indexed coordinator, uint256 decryptionKey); /// @dev Creates a poll and the associated Merkle tree/group. /// @param pollId: Id of the poll. /// @param coordinator: Coordinator of the poll. /// @param merkleTreeDepth: Depth of the tree. function createPoll(uint256 pollId, address coordinator, uint256 merkleTreeDepth) external; /// @dev Adds a voter to a poll. /// @param pollId: Id of the poll. /// @param identityCommitment: Identity commitment of the group member. function addVoter(uint256 pollId, uint256 identityCommitment) external; /// @dev Starts a pull and publishes the key to encrypt the votes. /// @param pollId: Id of the poll. /// @param encryptionKey: Key to encrypt poll votes. function startPoll(uint256 pollId, uint256 encryptionKey) external; /// @dev Casts an anonymous vote in a poll. /// @param vote: Encrypted vote. /// @param nullifierHash: Nullifier hash. /// @param pollId: Id of the poll. /// @param proof: Private zk-proof parameters. function castVote(uint256 vote, uint256 nullifierHash, uint256 pollId, uint256[8] calldata proof) external; /// @dev Ends a pull and publishes the key to decrypt the votes. /// @param pollId: Id of the poll. /// @param decryptionKey: Key to decrypt poll votes. function endPoll(uint256 pollId, uint256 decryptionKey) external; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "../interfaces/ISemaphoreVerifier.sol"; /// @title Semaphore verifier contract. /// @notice Minimal code to allow users to verify their Semaphore proofs. /// @dev This contract allows you to verify whether a Semaphore proof is correct. /// It is a modified version of the Groth16 verifier template of SnarkJS /// (https://github.com/iden3/snarkjs) adapted to Semaphore. The Pairing library /// is external. contract SemaphoreVerifier is ISemaphoreVerifier { using Pairing for *; // prettier-ignore // solhint-disable-next-line uint256[2][7][17] VK_POINTS = [[[13406811599156507528361773763681356312643537981039994686313383243831956396116,16243966861079634958125511652590761846958471358623040426599000904006426210032],[11781596534582143578120404722739278517564025497573071755253972265891888117374,15688083679237922164673518758181461582601853873216319711156397437601833996222],[1964404930528116823793003656764176108669615750422202377358993070935069307720,2137714996673694828207437580381836490878070731768805974506391024595988817424],[19568893707760843340848992184233194433177372925415116053368211122719346671126,11639469568629189918046964192305250472192697612201524135560178632824282818614],[5317268879687484957437879782519918549127939892210247573193613900261494313825,528174394975085006443543773707702838726735933116136102590448357278717993744],[14865918005176722116473730206622066845866539143554731094374354951675249722731,3197770568483953664363740385883457803041685902965668289308665954510373380344],[6863358721495494421022713667808247652425178970453300712435830652679038918987,15025816433373311798308762709072064417001390853103872064614174594927359131281]],[[15629200772768268814959330350023920183087521275477047626405113853190187031523,13589689305661231568162336263197960570915890299814486885851912452076929115480],[11464919285924930973853174493551975632739604254498590354200272115844983493029,16004221700357242255845535848024178544616388017965468694776181247983831995562],[17789438292552571310739605737896030466581277887660997531707911256058650850910,4112657509505371631825493224748310061184972897405589115208158208294581472016],[3322052920119834475842380240689494113984887785733316517680891208549118967155,381029395779795399840019487059126246243641886087320875571067736504031557148],[8777645223617381095463415690983421308854368583891690388850387317049320450400,11923582117369144413749726090967341613266070909169947059497952692052020331958],[15493263571528401950994933073246603557158047091963487223668240334879173885581,6315532173951617115856055775098532808695228294437279844344466163873167020700],[3481637421055377106140197938175958155334313900824697193932986771017625492245,20088416136090515091300914661950097694450984520235647990572441134215240947932]],[[9218320951536642499143228327011901814587826948504871816273184688188019956292,19717684456458906358368865507225121991585492363133107109865920739019288468011],[16717590750910963405756115910371408378114896008824240863060392362901176601412,18221695645112467945186983098720611586049108689347006136423489099202471884089],[4691595252082380256698158158199364410440273386659834000993210659508747323919,9205801980459323513061837717352821162780471027241700646145937351740096374660],[16150531426263112884093068164597994126623437929929609532055221646496813246000,20245743178241899668170758952526381872637304119026868520579207157118516761827],[6063536446992770713985314309889717594240410784717230886576072989709763902848,18258781411255795973918859665416013869184055573057512603788635470145328981347],[10109932964756104512054045207253535333686585863745296080906925765480296575285,4174640428253153601540284363759502713687021920150940723252842152556151210349],[18049428534741480832385046397049175120355008065781483226058177421025493210952,591730261265040164434889324846001338201068482543108348317417391345612814922]],[[3995128789564535587814512245259203300137618476815456454931286633947953135662,15953239752392927777442331623182226063776310198012173504208557434319753428770],[20957319343912866335583737646657534123362052690050674068142580221965936605075,2523786679709693946058523307330825034772478122295850507521258983130425334580],[9877211178693075145402462781884120278654771727348087433632224794894486095150,19972682062587174829535281061580296764150591339640180868104711395548066529340],[6324578424031095537345184040149690238371517387586958921377481904541316423724,15513931720576048544404512239839508014664224085062729779520992909505663748296],[11371337652479737143800707796204655130812036287859296372695832558127430723628,11757275188600040111649009832378343123994225623498773406233261322165903848967],[13282496583564708104981015168203451877588903263486398132954741568835583461335,1746144324840370907926720490289700342734912534857331743685374514401176014195],[7993952462467372951144011615584426050192046712674662254138390197508963352374,5156942148925224345709309361345680948125600198010285179548841917923439945819]],[[18976133691706015337908381757202123182841901611067930614519324084182946094218,1382518990777992893805140303684642328066746531257780279226677247567004248173],[6627710380771660558660627878547223719795356903257079198333641681330388499309,21806956747910197517744499423107239699428979652113081469385876768212706694581],[19918517214839406678907482305035208173510172567546071380302965459737278553528,7151186077716310064777520690144511885696297127165278362082219441732663131220],[690581125971423619528508316402701520070153774868732534279095503611995849608,21271996888576045810415843612869789314680408477068973024786458305950370465558],[16461282535702132833442937829027913110152135149151199860671943445720775371319,2814052162479976678403678512565563275428791320557060777323643795017729081887],[4319780315499060392574138782191013129592543766464046592208884866569377437627,13920930439395002698339449999482247728129484070642079851312682993555105218086],[3554830803181375418665292545416227334138838284686406179598687755626325482686,5951609174746846070367113593675211691311013364421437923470787371738135276998]],[[3811592683283527904145155808200366192489850711742363953668998371801696238057,9032545080831535702239063467087720597970266046938395860207839433937324718536],[16308433125974933290258540904373317426123214107276055539769464205982500660715,12429982191499850873612518410809641163252887523090441166572590809691267943605],[9494885690931955877467315318223108618392113101843890678090902614660136056680,11783514256715757384821021009301806722951917744219075907912683963173706887379],[7562082660623781416745328104576133910743071878837764423695105915778139873834,17954307004260053757579194018551114133664721761483240877658498973152950708099],[19338184851116432029108109461622579541195083625346674255186169347975445785058,38361206266360048012365562393026952048730052530888439195454086987795985927],[21178537742782571863590222710872928190886000600239072595684369348717288330049,9786438258541172244884631831247223050494423968411444302812755467521949734320],[11330504221972341797183339350494223413034293674225690456356444509688810101433,1490009915387901405464437253469086864085891770312035292355706249426866485365]],[[9485639152672984144988597737758037391807993615552051606205480347442429414340,17626503110323089701269363177710295379967225765713250625279671011873619640598],[12391874700409435648975069978280047983726144854114915177376036190441913967689,18953587685067712486092665232725058638563458484886448540567142557894080640927],[21791720972262589799021600767292883644106575897307484548888696814333235336885,11092962469758788187888592619035811117815082357439060720677582048880121542623],[9418924955930663972575130074928583215922927562059194231976193350658171304436,16113558481826020406162261319744796072664750077095575593106901121115073101408],[20054934960262983176880675919444457578562219675808407582143519621873973120773,14877415271301547911435683263206245199959943680225555496786470669330176961657],[4215199263810110748751715719957184804379752373072771007598572158043965517488,5225943468606602818132879686778547605180105897615251160509064537462109826521],[6250242626034734280813142093008675407723196706248829741247204621913994561803,1472231555266678689888727724824566171966416459791722465278225775922487343641]],[[9830856103389248449121962275587399130605902703453384856543071762984116567573,11408965575174993375815840422438995549652812400401163392501956884932167624437],[11814906841949499037550820576929552248172160643991870665022770052632331265834,19969543376625663966419118899515353499678204573709836615846115182224340858492],[3047486363455933831148688762823238723024952519326207356549121929667745957778,20241836359289449005887237560564358543646542598344362915541027571505243817211],[5965631918800530319167124148627450454569264331058008407732200168631989208657,20463557477532480934514091877628554948892025887087712764683631108388998871350],[16605042322692983282732511249912403956057999815658038166796858627082222971215,12219061498275616585164456833410962809536084885494309093787669879221959361956],[1548998572074037722622224303222294716243074837074272552644853986075252666508,10393312002885367652301897874262367916506364670364584602554176742602334134772],[16180907689593358346406392015123900260925622357393826746385511046141256905390,12267326749885120640972074479210537480053065569337817484467225562817467244765]],[[15035335306919942325459417688135340085377315274625768597233474641923619728582,10090041889587324002759549286390619541526396451963494627957072069124011137562],[21342049717074059749518233491526445388158772701642182532370641230478027030319,10507786999799841055999967456762679569286329319056926475375760604262707147294],[19590996174696909242575628014943555633938195923520472786993379268302478708283,2673753072556442230312995111304911178679525806396134504594492458566941824354],[13411253172375451489380472831999887223592471057462692619008484995624281735092,17181767455563581254432161119660408482332423481128600038352147258951772423229],[19138864631164378176055647711995352935065134904103255748190268290992108588628,14282526277736365863821375748687709839392307698935143595732632710176778519757],[20183773658676161990469276414858234178608794783112866811307579993999118293429,5223464433544489066271184294750886227362580875255044558831927430970236355539],[12333466991139269670298178539679773509487545471126920233507132846828588847444,3787586478923104354547687861486563468235879611952775292288436085429794222238]],[[15718373132479769904443326381037437528372212185108294117696143473979328398658,43456740675249348549891878341522275183186932745162972528932808393415299552],[11236864934894600819960883124570686936554376109344998527334431594565774237827,4289247401578837038775845192875793775418122783738936298355403103074020081838],[18580370382199518848261939652153768394883698461842792002922164533882262019935,20516185953882700254387267244708111605796661864845495645678049276372075842359],[20041291712709610738573661974551517833120775539593003477018637287434210072702,6326630253906616820412999166182553773360987412889775567442543181359104720511],[13268971611130152315428629919012388924225656285593904211561391821918930327614,9247437189452353488017802041158840512956111558640958728149597697508914590433],[6267384495557139339708615182113725421733376438932580472141549274050146739549,1832264154031452148715318442722960696977572389206897240030908464579133134237],[16650684165487873559901140599157559153018449083939294496255590830891994564285,14140282729498011406186082176268025578697081678243955538935501306868500498994]],[[1723458149089715907994189658689343304709709060535625667210252753337752162173,4023016874169005249382064394379671330447496454371261692205411970999350949293],[7651670126664625790835334090273463062538865895183205964669372719235003083565,17710652158212212080502343565075513548898593397103675832636832371532093744857],[4247947150009812467217672970806328247513830308400387953244764907353849211641,14500381439127180474801393438175928191199696177607750163263715436006533630877],[21213779524495874664157797605662894019112036728653622806607467354233012380232,1429370857470083395421401524518861545167550347090873730934256398864585069083],[12465277751642747637430517396067173985821959773399832969105187923427872239200,4377704428607835904642653580543541241155601291484645500691968624389522190030],[11283027832501128633761619552392013253304972822086786857121687098087331014745,21463394238922953607096052056881931791797740737164052798044623278557203313720],[19687293493101130967741578773742597470558958652351513582962108464055656171331,4445165696525061401582979300506082669540223774145877762689724631935313716632]],[[745924679191739894055143748466112994378439645681039136007774787076115375124,13132169670125192016391258838554965176628317453468870968867717287446623320643],[2126777833939378028304266129616145667925849332481755567268747182629795296580,20909608709868730010029182074820840312550443752829480953667886902663547957991],[3388767735894417381503201756905214431625081913405504580464345986403824999889,21014112837214011009096825602791072748195337199912773858499588477762724153070],[10521317016331497094903116740581271122844131442882845700567581775404872949272,13201921794561774338466680421903602920184688290946713194187958007088351657367],[16170260722059932609965743383032703380650557609693540121262881902248073364496,6004983491336500911294872035126141746032033211872472427212274143945425740617],[10275615677574391293596971122111363003313434841806630200532546038183081960924,5955568702561336410725734958627459212680756023420452791680213386065159525989],[19059081014385850734732058652137664919364805650872154944590269874395511868415,19202365837673729366500417038229950532560250566916189579621883380623278182155]],[[4553625243522856553165922942982108474187282402890756796515747778282922584601,16835654219229187428071649241190746119082269636345872682107941472241044260584],[3272293478534046729728233267765357195255129499603632413158978822084188871854,873742823867191038535544062852920538566418819521732785500614249239215175476],[7856986171681248404396064225772749784181602218562773063185003409958949630985,11707218736744382138692483591389641607570557654489363179025201039696228471230],[2902255937308264958973169948617099471543255757887963647238093192858290079050,4092153880227661899721872164083575597602963673456107552146583620177664115673],[18380478859138320895837407377103009470968863533040661874531861881638854174636,14502773952184441371657781525836310753176308880224816843041318743809785835984],[2781117248053224106149213822307598926495461873135153638774638501111353469325,3500056595279027698683405880585654897391289317486204483344715855049598477604],[8880120765926282932795149634761705738498809569874317407549203808931092257005,19080036326648068547894941015038877788526324720587349784852594495705578761000]],[[7252337675475138150830402909353772156046809729627064992143762325769537840623,7601443214415704135008588588192028557655441716696726549510699770097979655628],[436607343827794507835462908831699962173244647704538949914686722631806931932,18500126298578278987997086114400065402270866280547473913420536595663876273004],[18427701611614193839908361166447988195308352665132182219164437649866377475111,5299493942596042045861137432338955179078182570752746487573709678936617478454],[4188155714164125069834512529839479682516489319499446390214266838952761728656,2720966082507704094346897998659841489771837229143573083003847010258396944787],[13256461570028177373135283778770729308216900804505379897951455548375840027026,10722074030307391322177899534114921764931623271723882054692012663305322382747],[9824147497244652955949696442395586567974424828238608972020527958186701134273,15755269950882650791869946186461432242513999576056199368058858215068920022191],[21172488506061181949536573476893375313339715931330476837156243346077173297265,13892434487977776248366965108031841947713544939953824768291380177301871559945]],[[10202326166286888893675634318107715186834588694714750762952081034135561546271,15028154694713144242204861571552635520290993855826554325002991692907421516918],[18486039841380105976272577521609866666900576498507352937328726490052296469859,12766289885372833812620582632847872978085960777075662988932200910695848591357],[1452272927738590248356371174422184656932731110936062990115610832462181634644,3608050114233210789542189629343107890943266759827387991788718454179833288695],[14798240452388909327945424685903532333765637883272751382037716636327236955001,10773894897711848209682368488916121016695006898681985691467605219098835500201],[17204267933132009093604099819536245144503489322639121825381131096467570698650,7704298975420304156332734115679983371345754866278811368869074990486717531131],[8060465662017324080560848316478407038163145149983639907596180500095598669247,20475082166427284188002500222093571716651248980245637602667562336751029856573],[7457566682692308112726332096733260585025339741083447785327706250123165087868,11904519443874922292602150685069370036383697877657723976244907400392778002614]],[[14930624777162656776068112402283260602512252179767747308433194885322661150422,13682963731073238132274278610660469286329368216526659590944079211949686450402],[18705481657148807016785305378773304476425591636333098330324049960258682574070,21315724107376627085778492378001676935454590984229146391746301404292016287653],[12628427235010608529869146871556870477182704310235373946877240509680742038961,15093298104438768585559335868663959710321348106117735180051519837845319121254],[6593907467779318957599440584793099005109789224774644007604434924706249001015,18549596630007199540674697114946251030815675677713256327810772799104711621483],[6271101737045248834759003849256661059806617144229427987717476992610974162336,355748132218964841305454070022507122319085542484477110563322753565651576458],[2116139772133141967317791473319540620104888687412078412336248003979594158546,4004400204967325849492155713520296687406035356901102254880522534085890616486],[4206647028595764233995379982714022410660284578620723510907006350595207905228,19380634286337609988098517090003334645113675227742745065381519159322795845003]],[[12315240965742683516581565369496371929586281338862761742109651525191835544242,18994803742708336446369128568423705404354655742604689352630273180469431952708],[18019403342409608922812569436317484250134945386869657285229378095251425778096,12707009780301102830224094192984906206920666691015255692741008594808694787917],[2592407181901686208061988776764501828311271519595797153264758207470081204331,11847594161160074962679125411562687287595382335410213641115001866587988494499],[3346927026869562921166545684451290646273836362895645367665514203662899621366,15758185693543979820528128025093553492246135914029575732836221618882836493143],[20528686657810499188368147206002308531447185877994439397529705707372170337045,18025396678079701612906003769476076600196287001844168390936182972248852818155],[9799815250059685769827017947834627563597884023490186073806184882963949644596,4998495094322372762314630336611134866447406022687118703953312157819349892603],[16176535527670849161173306151058200762642157343823553073439957507563856439772,21877331533292960470552563236986670222564955589137303622102707801351340670855]]]; /// @dev See {ISemaphoreVerifier-verifyProof}. function verifyProof( uint256 merkleTreeRoot, uint256 nullifierHash, uint256 signal, uint256 externalNullifier, uint256[8] calldata proof, uint256 merkleTreeDepth ) external view override { signal = _hash(signal); externalNullifier = _hash(externalNullifier); Proof memory p; p.A = Pairing.G1Point(proof[0], proof[1]); p.B = Pairing.G2Point([proof[2], proof[3]], [proof[4], proof[5]]); p.C = Pairing.G1Point(proof[6], proof[7]); VerificationKey memory vk = _getVerificationKey(merkleTreeDepth - 16); Pairing.G1Point memory vk_x = vk.IC[0]; vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[1], merkleTreeRoot)); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[2], nullifierHash)); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[3], signal)); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[4], externalNullifier)); Pairing.G1Point[] memory p1 = new Pairing.G1Point[](4); Pairing.G2Point[] memory p2 = new Pairing.G2Point[](4); p1[0] = Pairing.negate(p.A); p2[0] = p.B; p1[1] = vk.alfa1; p2[1] = vk.beta2; p1[2] = vk_x; p2[2] = vk.gamma2; p1[3] = p.C; p2[3] = vk.delta2; Pairing.pairingCheck(p1, p2); } /// @dev Creates the verification key for a specific Merkle tree depth. /// @param vkPointsIndex: Index of the verification key points. /// @return Verification key. function _getVerificationKey(uint256 vkPointsIndex) private view returns (VerificationKey memory) { VerificationKey memory vk; vk.alfa1 = Pairing.G1Point( 20491192805390485299153009773594534940189261866228447918068658471970481763042, 9383485363053290200918347156157836566562967994039712273449902621266178545958 ); vk.beta2 = Pairing.G2Point( [ 4252822878758300859123897981450591353533073413197771768651442665752259397132, 6375614351688725206403948262868962793625744043794305715222011528459656738731 ], [ 21847035105528745403288232691147584728191162732299865338377159692350059136679, 10505242626370262277552901082094356697409835680220590971873171140371331206856 ] ); vk.gamma2 = Pairing.G2Point( [ 11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781 ], [ 4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930 ] ); vk.delta2 = Pairing.G2Point(VK_POINTS[vkPointsIndex][0], VK_POINTS[vkPointsIndex][1]); vk.IC = new Pairing.G1Point[](5); vk.IC[0] = Pairing.G1Point(VK_POINTS[vkPointsIndex][2][0], VK_POINTS[vkPointsIndex][2][1]); vk.IC[1] = Pairing.G1Point(VK_POINTS[vkPointsIndex][3][0], VK_POINTS[vkPointsIndex][3][1]); vk.IC[2] = Pairing.G1Point(VK_POINTS[vkPointsIndex][4][0], VK_POINTS[vkPointsIndex][4][1]); vk.IC[3] = Pairing.G1Point(VK_POINTS[vkPointsIndex][5][0], VK_POINTS[vkPointsIndex][5][1]); vk.IC[4] = Pairing.G1Point(VK_POINTS[vkPointsIndex][6][0], VK_POINTS[vkPointsIndex][6][1]); return vk; } /// @dev Creates a keccak256 hash of a message compatible with the SNARK scalar modulus. /// @param message: Message to be hashed. /// @return Message digest. function _hash(uint256 message) private pure returns (uint256) { return uint256(keccak256(abi.encodePacked(message))) >> 8; } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": { "contracts/base/Pairing.sol": { "Pairing": "0xee44c1e83a768e80a3588b409f1a010f9d1dd7e8" } } }
[{"inputs":[{"internalType":"uint256","name":"merkleTreeRoot","type":"uint256"},{"internalType":"uint256","name":"nullifierHash","type":"uint256"},{"internalType":"uint256","name":"signal","type":"uint256"},{"internalType":"uint256","name":"externalNullifier","type":"uint256"},{"internalType":"uint256[8]","name":"proof","type":"uint256[8]"},{"internalType":"uint256","name":"merkleTreeDepth","type":"uint256"}],"name":"verifyProof","outputs":[],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526040518061022001604052806040518060e0016040528060405180604001604052807f1da3fc88726dcb210b80123bb09b40a86a57eb1cec7f3bfc89f91fe20622d85481526020017f23e9c269ed42423dbc44ce369cb78b342abe93731dc033216dadcb06c724aef0815250815260200160405180604001604052807f1a0c25b74f55683ebd0f8be53e188563362403cde2dad828ed917a8497ec367e81526020017f22af2404c15a320d0d67ee7c997eb497cea0208f443a620b9921f4a19402cfbe815250815260200160405180604001604052807f0457d05481ef2e919c3babe640b224438ac736c190b616070505bc66eb0a334881526020017f04b9e760240ab0439ff305c89eede1c06e7e4a3a250d3fce09eaa12e43c2a610815250815260200160405180604001604052807f2b4399f1079da135eff8211a2684b3fc5bbd79204198a7a537ed0c20a58c3e1681526020017f19bbb4d125a0c826783c15728d6cf28f267ffbf330c197d39bd6c664b9ba2836815250815260200160405180604001604052807f0bc177b0557e29966e89a33ca900b78647df9e344b65a6a12055eaef2b67536181526020017f012aefa5250fc5e72896094908c0f111ece72eda1b36ddbc8185fa1c2eaa6310815250815260200160405180604001604052807f20ddcfb90110e0e1ea7af6934ee1c67408af27964f44780c982426a9d988856b81526020017f0711dfbe9c6fab32ebbba6a258c2e97b91becc667aac1a357cb9a275264fe0f8815250815260200160405180604001604052807f0f2c85fbd7696d73949bc294dd362953ff7eccf67a075b84193d082839c3614b81526020017f21384f8b567278eaff9c8240269e5f739e530540be8312ec617183c572ab7e9181525081525081526020016040518060e0016040528060405180604001604052807f228dd06c5de709e7b53f38a850876a16f1b1437acd5f2dfda9ce83fb59189be381526020017f1e0b7dd795bbd17d04ca4b8aadd5a4a86f146e9f16ddff7519a72fea86796558815250815260200160405180604001604052807f1958ea13532b11ab4e211c7aa631c5eb6ed2a34d97fdc39fc39cd73bd35f11a581526020017f23621187ade6b9c56f2962955e72b4843b51481cbdec3cfb5ab4b948c56fd4aa815250815260200160405180604001604052807f2754771b51f24b62a15d2c53a6a1cc408fcc7a623b3e7f9823d52d629f5a765e81526020017f0917ae814c9db420f2ca2c678dcdc58adbd41c938041719c1b50c64ec72c8b10815250815260200160405180604001604052807f0758371f3dff3ee4c7c68d8c36f2e04254b9a4f7446521c75a30bdee9dc6fd7381526020017ed7a7adc8c0c2a3fb09602aa14d3fa1764d15bdb150fd0f03ee69b3b60cb61c815250815260200160405180604001604052807f1367f89c851a9003e69384b623a614d3afa8d2fc51f5cb5abafc67e442baa96081526020017f1a5c8221479bd8a8d50a74dd46d9e6f6cbe2cb6768a2429223f747a2f00685b6815250815260200160405180604001604052807f2240e05d565c404d5abb2f425a8fb849793bf671dae88e4f2567a617119bbe8d81526020017f0df676ebd848824af90c8f9bae101c3e0c687ee8facb7f2279f506a5881d929c815250815260200160405180604001604052807f07b289755dcdc3a38163bce0f2b12f0e3c046735d27a534c9941cf6683e7db1581526020017f2c69a3fee54303f17d8994afdac6e460545928a676307d5124c489b516e518dc81525081525081526020016040518060e0016040528060405180604001604052807f1461627fb9791e5a96fce79d89fca07b82d7556c84a3d4414367740957c7da4481526020017f2b97d05ca1d20d9abdec2e593937665b71c126735a9b7e601940c3f2758bda2b815250815260200160405180604001604052807f24f5d230612998286ea5e1f999d5bc8c4a635ee9864099913b6657633c7c4b4481526020017f28491d3fa0c8200cd31c9e3be4e423939a16a865d455bc00e411cff8787f7539815250815260200160405180604001604052807f0a5f594ba7d550aca92b125cbc6c6b564139e3fd5c5937f3bd5220df88554a0f81526020017f145a4c9d47805092bcebcd7e8c39b0f32b10f534475fd3a448cd6177f56de784815250815260200160405180604001604052807f23b4e079081aa0ab98aaf8a230318cf6e9c97bba977f6b3065a58a82483f663081526020017f2cc2af3f384010f2ac7435166856fb959625d567c92ce9ac20073d063e0e94e3815250815260200160405180604001604052807f0d67d70ad74db3b2eafec2ca2c819816e487d1fa29a15ca213f38a46a77c7d8081526020017f285e1aa325995fa12936d0eea843c4b0dd0ac6db5510826f9b585c1680632563815250815260200160405180604001604052807f165a04ef5bee8a96c8119c31502842aa34d60394793b8f937def7459b04d713581526020017f093ac34388aa5f6d55d8270e5a66328a04990230698de2326ab6e0495464816d815250815260200160405180604001604052807f27e79d515fe3439ddf81a8549902b5e9042e201c6769b8910a18dafed11d574881526020017f014ee84f3f0eeefd5ab1f81da564af7864d6204e9ccbfff66916a85d13e6fa4a81525081525081526020016040518060e0016040528060405180604001604052807f08d529aaca586b844314f80edfb1784260646108b75c158ce3f088c188bc802e81526020017f234536b6213200b2b44aebffcf0b574a2d0f4f2b47ef98db4b4431cfefc3bf22815250815260200160405180604001604052807f2e556c221fa59c978e78e9bba38e8947b59ef785b5e31ec8cf90e613787fb79381526020017f059469a2c10792ee9f1573148667562f175586470cea1dbb54bed106ef361b34815250815260200160405180604001604052807f15d64dac8e74c233b7859722356fc14c262242ae306c20f060880dbd9baa452e81526020017f2c28232f85d16cdd157a841cd7795ae537f6769d6b30fd18e9e03060246cc03c815250815260200160405180604001604052807f0dfb95a3e8c20cf8a70021ad12080f778abc60508bfe088803fdd53c46b4202c81526020017f224c92fd97d25de5d97901b9046ee6a5788dddf425cdba5d6e8ecf6ea83248c8815250815260200160405180604001604052807f1923f2f39f07d16e03562b8f1efed58073a457af74aa02179ced725e015b682c81526020017f19fe61c672e47a96a72333d6a66b7d8447ed8838fda18031d49370f0b7667607815250815260200160405180604001604052807f1d5da06c3e0fcfbe6c9e08f3f0eb1aa56b2927d65f2517bd5adbdab0609bc7d781526020017f03dc485cb2654fa526804696fae41fed451342bbfbcee7cc006f4f2271514d73815250815260200160405180604001604052807f11ac6ab06bbe07af99a7b46a2e5b3b9b80f5a57b64298f686c8660e36ea8bf3681526020017f0b66b9cf601565d1ea0341acb52c80d0114f7cf805b0d2a94848782bcd9c285b81525081525081526020016040518060e0016040528060405180604001604052807f29f41c6e0e30802e2749bfb0729810876f3423e6f24829ad3e30adb1934f1c8a81526020017f030e7a5f70bb5daa6e18d80d6d447e772efb0bb7fb9d0ffcd54fc5a48af1286d815250815260200160405180604001604052807f0ea726b117e48cda8bce2349405f006a84cdd3dcfba12efc990df25970a27b6d81526020017f30364cd4f8a293b1a04f0153548d3e01baad091c69097ca4e9f26be63e4095b5815250815260200160405180604001604052807f2c097b31a897227a6f64c9fc31d9a8fc421b0d8b8207f92532b464e431e61db881526020017f0fcf6d89d77d5123a43dfb23efb9c929c28c148ca82c794057864b8e66903c54815250815260200160405180604001604052807f0186dae5999acfe2cda6fa7a157ae726afda7c6f57b00ea0aa6c2c23bf83838881526020017f2f078608f710c45b60d23716c58e106d8c7a1c6db28119defffc413e074f8716815250815260200160405180604001604052807f2464c1784bda2cbfb51e5ab87cf7eb2764ad81f7038152bdbbb07d404b49aa3781526020017f0638b273e4ee33e03e42ca6c7de1ea7043dbdcaa48661864de644d91c6b4821f815250815260200160405180604001604052807f098ce8b5289ef791db34b68b9e0043ab7bf25306d83a9f0ce74396b8a69c57bb81526020017f1ec6f7a81748f3d2c2b87610d747ca72045ac1530e226f00710630d41aad7e26815250815260200160405180604001604052807f07dbf682cc528d3ff763fa576d05db50e023921728119ef66f880b6adae01cbe81526020017f0d287dcd9318207576eaa871e7b3308f613d9df7865059cdbc9f66fdef342dc681525081525081526020016040518060e0016040528060405180604001604052807f086d48f63f5c71cf5d49053014fd136b4f528a67c3d2500dc0359017376ef9e981526020017f13f83d45b3aa4ec86d3b9871cf43ccd7633306b29af07e7c70b13a212501b9c8815250815260200160405180604001604052807f240e3efc96e362bb9412aad60ae0ec25d4fced28aac3aa803e7287d3b6d425eb81526020017f1b7b1edff9f984c2ea43d3aab2487e863a4dee1c266fa2fc05f2a53bba124cb5815250815260200160405180604001604052807f14fdea340c7d5e62f830e244237c704e516d90f29a5e71f45928e97bb160376881526020017f1a0d3b9393c5595d11f31f2cb0b38834d26debc568a0b36e26fa93b6b05f70d3815250815260200160405180604001604052807f10b7fcb32afd1649ac4560aff9047bc52972befd38a21b870c0519719afee22a81526020017f27b1c713b71efa1eae72c81675ac78c578fa7ac8718cbd58d84fbe432f3d6783815250815260200160405180604001604052807f2ac10655edcd4c74305d2d323239400baf8541470936b2e1ac77167e31e8a9e281526020017e15b63038e94a1d4d5a85c7a666875e7f693a922ea2723a3e39f256b240f607815250815260200160405180604001604052807f2ed2a0a894b904559562fb1643c8b69a743e39a15455d6c6a0d668b32147934181526020017f15a2ed81d1ac5a1383524fd4daf70220034a6f40d643da7b79f9a20cab1895b0815250815260200160405180604001604052807f190cd68f815b152eb0c8474be622c18a56d2e518bf6ddbb929af7d50a2cedab981526020017f034b50d36d6b6dc03d6e6eb0f731eb1dd5df2f6300a760eab888e859f45f387581525081525081526020016040518060e0016040528060405180604001604052807f14f8ae76e209b3857222b80044dfc5baaafcf6e30497fac6910d74db4f99cbc481526020017f26f83f4984eb300f438c191ac9c7cefa55e22cb19fc1c29cc690eb0b03c70116815250815260200160405180604001604052807f1b658d7292b467a21e49116237813440d88a76fa6ef89db931e09b17ed0be44981526020017f29e759b830c254718fea4dfbbe6b17edc38e4b5a43d343eeb473f9894496b79f815250815260200160405180604001604052807f302dad4ea4d062effd18ec15d4a252b5881e1423a26ec6c859ec09ddc44496b581526020017f188664ee38c3f83423eb8c75ebc54d7ba95d5a728a3f7186fb4eb96e0702f7df815250815260200160405180604001604052807f14d2ec2fcb446a46ea217305921bbaed7b89d6059a3a044dba8dd6943b0379f481526020017f239ff36e4d70fee9088c5e61e7b5974d9726f6c554266bb26608973532913e60815250815260200160405180604001604052807f2c56b0e10ffbd7514c0c3e402662681881f06cf50ff9338a73b6f1e5f74ccf0581526020017f20e451924e71fb82d8f77683821fb35996645442b49e4a801b99256e51e66c79815250815260200160405180604001604052807f0951b7de5b62bfa1727fc51f791f0e8c9f5a89012fdcf10426bbb9f422ea6eb081526020017f0b8dc77891aa39b647a3e3044c7c2fdd27e06c4aa55c4e54b9a3cf4c4096edd9815250815260200160405180604001604052807f0dd1830feaf2cd658f56300da9a0a5a8cf324a1ed720c283c86bd37f7484090b81526020017f034140e7667ae5210cf863a7c8975117172af40f2d45e635e5b9f5042be9ba1981525081525081526020016040518060e0016040528060405180604001604052807f15bc113f408c7e7a786363979ae9279915708775076e86a44495064804663e1581526020017f19393ee4d81d952e8bf375888005c8314c87c632eebabd7a8d55940b0f7a66f5815250815260200160405180604001604052807f1a1f001347928a9a21ea414ccc67c3d1590dc29d437d68fc3ab020efb6ada72a81526020017f2c265c6b30a34bd323024f87bf2cd5a269e77c50c75e5ea317280785f91eb67c815250815260200160405180604001604052807f06bcd0efa27998d5f0daffaad7d6a98e3d0fe589e261f9b30c09169ef488479281526020017f2cc0792f40378327989245d05e386fcff9a2a9aa285746043cb3f621ae2f04fb815250815260200160405180604001604052807f0d306d920f3cc9d08dbd4549ebb3dd8d5fa10bd2c0a6663cd08e62915734865181526020017f2d3df68c9b28bf980dfea7683eba674a0415a26017ac2bef27176b88ca57f936815250815260200160405180604001604052807f24b61ef328570152ff83827a0f379f6c542398f3d1bc542c2bc34edd031e294f81526020017f1b03be64a67b3976e58415dcd6b353b32be9b0bad35d2d18b296453a28d985a4815250815260200160405180604001604052807f036cb3be4f36d6f5b34d8808b1e3e2ccb3fb1e3fd249eea06b1cc6761320b08c81526020017f16fa67f812376a8ac79a40970332c6ec7ced15f9539334fe642164284775e1f4815250815260200160405180604001604052807f23c611b7426b5dbce2f272a6046db21be35abadd4293876ecf50d58c5f17b2ae81526020017f1b1f0f9654e7d10b58ddaea64e20abee44f52bdd0cb58123b69c9011b497e0dd81525081525081526020016040518060e0016040528060405180604001604052807f213db2bdfb128fec0e98d364b9109caf26d66cacbbc808535af07af00200acc681526020017f164ec2e66021720a0d70b0cc70597ed748f0af9b080f5e789a821de5b0a91a1a815250815260200160405180604001604052807f2f2f2c0cc9d9b911a348466a4749c3a49d2629c9dde430ec9474f2bb06fc7f2f81526020017f173b3259b29d0e0c0176e2424bee65405bdd1e611bb933c19f5bfed931aab21e815250815260200160405180604001604052807f2b501c6317c16d185d7797db4b8735388ab31aa4d5d022502dce7c0fa5f30e3b81526020017f05e94a656be4a2f9128583762dc9e007d450315e71ef4d6cf82e64ee74325562815250815260200160405180604001604052807f1da680138dd3bdd851d6edcb441a137301ca1902c6c50036b27153520aee7fb481526020017f25fc89274231e8228cba90e52607039681d60f5d6b3a07fb429d116f53a4443d815250815260200160405180604001604052807f2a5036a81225c106605e7233124414ca2359360b60f19da736e6b4ebcfc9ce5481526020017f1f939f972ad716e18a465e4c5ec3669976b77364106a0cd73418ba058b7884cd815250815260200160405180604001604052807f2c9f9c6dfd0aa6e591235ad81a9923fe056846ca742e53af6a571ec00519d9b581526020017f0b8c60480c49dcfad4a82226600a9569494567e627301779e35b9bf8e0fe43d3815250815260200160405180604001604052807f1b447eb43a748829489de9e667c53a3053498f9adaa59b0bedcc7c8b463f515481526020017f085fb2aea389c48f2e7d17242f64b5bc3506cdf55b20bf9395da0e2f749bb09e81525081525081526020016040518060e0016040528060405180604001604052807f22c048af0497a1f7d9822f8b3edb498f614b85ce744ffe3e6ff58119d161854281526020017e18987c19177ca3ef0a85089090a97d608e3a9648b25d4ae1f673c134c591e0815250815260200160405180604001604052807f18d7d7154f3e946f1d5930f5c95f3b76bf39cfd3cc0266d8e9565df8e1ce608381526020017f097ba0c470041aaa08b64e9bf5a1bfe568d9a7689a7c597bc5c87fd9acc1c0ae815250815260200160405180604001604052807f29141df1097c02a70ac3504a99ee5e8bfbea03aae01a3c2ab86ebe0cb9265f5f81526020017f2d5bbfef49b2e4745d3a349dd67a035cfd4ce9313d3a20911376b21ec05e8b37815250815260200160405180604001604052807f2c4ef818e2918b7c272380c498e5c402928e4598adf31db243b591362011587e81526020017f0dfcbeee8258030ee712429f77d640767a137fd809bd80027218d6719c14fe7f815250815260200160405180604001604052807f1d55f8c7220cc6989034a2259e5764a0687c9410421fa5408174906d1511d83e81526020017f1471dd2d031a794968eaaf6a8e5551fbc8163c20617876438d535b2b383172e1815250815260200160405180604001604052807f0ddb36c33249944ac8bf7f0222f37712681d705bce9e0ef786fb6283306a255d81526020017f040d0656b2bba0b1b3c21822ea3fd5671359a1a04d76473b68217b4616f9559d815250815260200160405180604001604052807f24cff40932a3db30de20c16b20e68497cb42c750483824c3ef371f4e9045c6bd81526020017f1f431dccba254912b6a795ee36dcd115094cb44367768abdc27bbc5669eb8a3281525081525081526020016040518060e0016040528060405180604001604052807f03cf7157aba9c6be40a06864fa2c0e06f7178133d9c3768ff3982814946b0f7d81526020017f08e4f2655701b165858a2fc04d15297c282aec942c4a521cbe687772a2a775ad815250815260200160405180604001604052807f10eab11af7f34e5cdb73b010a98d7f18c7410eec5d8eb1b4526359f5ab246b2d81526020017f2727dfb72de41bcd49e47c8940bfe75b600bd39467763baecc6f8087130866d9815250815260200160405180604001604052807f096440bcf7534fd07ca2a941ad8fb743c49c0a5684920ee13e992f3ab8342af981526020017f200eecd036971149677fdd19a7f2dc2e2a33a460211994adce7f967da2920b9d815250815260200160405180604001604052807f2ee692deea7671684657a2ee16ffb165dd3bfd3cb8af86620b7d0feeaad6624881526020017f0328fec7c2ec04f0a7375c917f31ee23af341252c71051e8cd9a80ce9080121b815250815260200160405180604001604052807f1b8f18e1106fa4188030c6c00b7a9b76bc309ffadb11f47d5ff38bd616f06e6081526020017f09adb161ecc2264110216d13cd5dad70d58dcc398f9431844f9faef1baabeece815250815260200160405180604001604052807f18f1f7aa58cecca54d15b583367484da5dfc809734621c5699e4f812131b285981526020017f2f73d9c341a4bb3a5737672b5e6191848505c5ba127370425286901bf628b438815250815260200160405180604001604052807f2b869cfd2665da2a22c29622642595edd5bcded7e84209a1a0cd0a07c2d0c74381526020017f09d3dfe76c7b340c97705915c61f06591d27c5e3ec9e9a91582188298aab259881525081525081526020016040518060e0016040528060405180604001604052807f01a62dac147fd2d28c728dd7692a3505c43fa3ac0d580acde5208af76827a41481526020017f1d088b6d1f7c61f16092a5e2ef4a1f9743db839996d5e3e055b020d21c807a43815250815260200160405180604001604052807f04b3b6ae3a5a0590cf6c632dd5b19fad64b35508945e76465baab77eab5a754481526020017f2e3a6b4c59e33e5d9f5f309887f89b55e69614d8ae0fdc337f658a880e4bb2e7815250815260200160405180604001604052807f077df97d4ad49afc58e0990d3f4c43fb5a66de4fdb6c149212dadd1120da9dd181526020017f2e7590fddece695cf2e40c353691bbaf6e48a631b799dc51ea400db7168fc6ee815250815260200160405180604001604052807f1742dab9e730eafb41b052f0f9452b449d3424442df19e5e9ca46b1eb37ede1881526020017f1d3005df367bee452065f076925df17570f53f8c90f66780d986343035cdbd97815250815260200160405180604001604052807f23c00b1148eb39bf17c89e79bf445d07d112d956d3e1a07048fe1d937d00041081526020017f0d46b3410227aa67c7130da647213a8c964536737735218df087db3c101ce349815250815260200160405180604001604052807f16b7cad8bbcc92747ea1b6d25279e35222f5f5887691feee05fe82e04f3665dc81526020017f0d2abb809fb2ad694b1688bc906ec63b5f6155f0d45939c0d2ab96a70bda1665815250815260200160405180604001604052807f2a230ebd4006758badc83062c05a841f6467045ee5d4b5952ef2c6e786ed4bff81526020017f2a742766ba7e97cf0d388821cbb1ca01d0102c3b7880e9c976b19c5e2a698f0b81525081525081526020016040518060e0016040528060405180604001604052807f0a1142b39cac59d311fda518c2d4eaadaf36319a0b1cb5624b52b11768062a1981526020017f2538a481cee0a6745650435dd283ebe8a0186824a30756d83b6afdd7fa6186e8815250815260200160405180604001604052807f073c0d6ef96d93468e746fe7a9688f3053d5c9a96c3a2b039b7096ca0a3a9cae81526020017f01ee855a906702a4d58af8e0a49c4db6d58da5f166ad7283223b079b96e97734815250815260200160405180604001604052807f115ee58656b27d353eaf5e01de11f58159d35750e4df5753c25ad967a588340981526020017f19e20d0d752f4a8feb8aa3184b57129077b63d6c7023f816f54d470bd51751be815250815260200160405180604001604052807f066a9e5fbc3e8612b3401e42befc4b9f5e3428bf08ec91ef104cde862e53c54a81526020017f090c13b76bc68d4307215f8025bbfa13e003accc57b6055b629f13f2e87383d9815250815260200160405180604001604052807f28a2fb7c5e7425e4b49b1865ad6b43c8ba34c642f58aee8db5d352f93201a7ac81526020017f2010477774686ef83e8f2af52b3b04795e145b0228cd6af3e60c0ea87c87b1d0815250815260200160405180604001604052807f06260e7c05ca5ad151092a548392246cb2d3ca6fbeaa07ba5aa629977702698d81526020017f07bcf63a827724040c9944cc4314d740cd02a1d7fddd54ad6aa8da63e83ca524815250815260200160405180604001604052807f13a1f861a361a435d3c15ad8be0f73afe724f09a86f2f0bc8731889232a258ed81526020017f2a2eeaf8fb3ea2c877e411b9b541abc46be4b2782bff6ec46157fe8d1f546b2881525081525081526020016040518060e0016040528060405180604001604052807f1008ad7b2099ae56dc0478b9b79dc31c9d9973352ee80a724ec1be777d49e5ef81526020017f10ce43af4007cb53217273748eff14ea3894d61d16b4d25c7e4ae5c28edc85cc815250815260200160405180604001604052807ef71c6a739cf1c46d111ea159ecfe61278f110bc41f61b4d87d10c8643ad3dc81526020017f28e6b34e8d433462f6fd110ddb1b39bab64bfc4cd5aa802fb96a2d73970c336c815250815260200160405180604001604052807f28bdb5a19bbac721cd1599254ae6278ebf250f1c5d569dc3128e21f11a5d342781526020017f0bb76843462a16985e13a6dc0592851549070ea3293c187d63f0df32f0dd6936815250815260200160405180604001604052807f0942698159a2ef1d9a9420193d83bf956081197e10ac7ab550ebd932aaf19e9081526020017f060403214a5dd63e1f8ad5821a89eb3fd389856b2d9e6d3915f6a26dfde89993815250815260200160405180604001604052807f1d4ee42feb438c818d15badde8d1ba7c615d85e6c9e93df8605470d5760f719281526020017f17b47a9569d5ec3bddafda249ac91e97070d549979262cf3692242caa17c459b815250815260200160405180604001604052807f15b8453b386c5563cce2a22af5430b941bb1709202f58ef9c4a48413d9e499c181526020017f22d52ab21357018eb24ce7508c0d04130c1ddea4a5136cb73ee58063bd8584af815250815260200160405180604001604052807f2ecf342deb9fe786ca4772c3a0b3cacae3ab5d1942e0a08eb4696041d576307181526020017f1eb6d6da821f70eb0b7b9372cfdde917839d8977b90b5ad48f472b33ac64850981525081525081526020016040518060e0016040528060405180604001604052807f168e4fddac50a40d5bcff39c7fa9207cd368444c0c01a86690a6645b52f3aa1f81526020017f2139a256456825daa623957c4f2ea1a0d26f135769e450759142a7159b0a4476815250815260200160405180604001604052807f28deba4ed0a3b79dbc6a7dac67c07051f421904de49dcd7ae91aaf1223bc6d6381526020017f1c3976c9a490dad50e601586279bb60f12416a8cc141710167fcdc0dc931bffd815250815260200160405180604001604052807f0335f514c2acb9b255aae85514122267cd7d16e374c6231a2c34417d3449125481526020017f07fa1580c1cc3ed4f6d660c6f60f86afedd8a12fb90b2e8ed4f7e310c88b97f7815250815260200160405180604001604052807f20b781dd0db3b7980a4b3814128c86e597e1442d0fc9eb7f932a5229494d6b7981526020017f17d1cef436eb2f665670c7b34854e62c227043a7b111a539c0295518bbab3ca9815250815260200160405180604001604052807f260945445b4205f874ab7e203a18240e51c9d3c896ea300d40132b1c2f50299a81526020017f11087a8b76b0f957e1c482c909302916795f811a06866059e403689c01c903fb815250815260200160405180604001604052807f11d20fd81c0e5cf48ba1469ccb8ac99dcdc7cf746a6e70762a939d63dcc52dbf81526020017f2d447c5f134eff527d7bcaace88b3842c42b800d8dc049e0a6e72f5efc14293d815250815260200160405180604001604052807f107cd54a1606a6a873bed4c1b76af48975e66dcf6c127b4c799ad4fdd230b87c81526020017f1a51b81f6c07725ebcc56ebb1c482b99340eaa9bcb86cc09aed6f58a28e530b681525081525081526020016040518060e0016040528060405180604001604052807f21026f2492115bc10ad0a5d50cf101474fb0c5e53b25612d8156989bb8cbbed681526020017f1e4048744f2e211ffa8cfac1d2efbae21234bfaa15c8d640171182c9b386e8e2815250815260200160405180604001604052807f295aed6c2486154603e450f3d49b39fee1bf9ffc4bc4194f403a02d66e7954f681526020017f2f2045b5a78523c7892e775d7f8fe805563acebd5ab053745ea735ab7930afa5815250815260200160405180604001604052807f1beb6fbfbc70fb2711bc7c187cf0ec4b63ef6651b02742c9fe71de1aef7ffdb181526020017f215e8105a1a572b106c2bb0d1f0170bbf8ffda20957ea14b709a7f6cc778f966815250815260200160405180604001604052807f0e9404f55d91e9964e7b921158995a81097cf27b017273cc2c133107c653483781526020017f2902b31b20c04311298f9b90026980b7963a001834fa663eb83636ec5fdb7b6b815250815260200160405180604001604052807f0ddd515b58aa44c26b377e2c82c83c7d75722131ee7139ddb18082e2da8ddda081526020017ec958a799e9a65df6bd806e7bb76140d415ca61d1ffc2b2351b12e85553268a815250815260200160405180604001604052807f04adb15295c975c172a9a508c71dee5517223306cd091fb9881d0dca5d57d1d281526020017f08da6902b366d39b8a7ef07c831486aabbf834bbd07813bdcdb92be7850b2ca6815250815260200160405180604001604052807f094ce0ba5287bd96c37794306fe6b0c5541fc77f05aab2b4b8a80564d086bfcc81526020017f2ad90cdefdb6c12edc35cf483e270516b0ad3ed872dad6031ec705fba888258b81525081525081526020016040518060e0016040528060405180604001604052807f1b3a2deb5f90e41493bd6eca49124ffd998376cc19df2a131f619a9297e76ab281526020017f29fead8cbc4c7d473dd6a1f39e066c1a3b065c3d02407b8d977a6f4dc528e544815250815260200160405180604001604052807f27d69ef118055fceb37561e935fa4927952116ac0c00fbb8d2131ab68e12d9b081526020017f1c17e9a456e1a74448a960dcfe32f84bc0fa84f1ea428f907f0ae9e3db1e4f4d815250815260200160405180604001604052807f05bb401ea4577a1cf48cb24f6668ae5a9621b808d302044b53016f7f29fce06b81526020017f1a31802b5590506650d4bdb3b20c9ae4aec7a5e1430202ec52fbaa35c78b08a3815250815260200160405180604001604052807f07664b2723c11dccc1e71f59742b84568e6a5d1b7df21cd86f02f976047a2df681526020017f22d6d128fb4f49c32dae5f249410aaf0b2e039a9fb0f8aea8929da4bbe0cf357815250815260200160405180604001604052807f2d62d32c2ab7039c0294535b501330cc326affb6ac0c4d34a1971857fc5a5b1581526020017f27da035244e64180b7abfd1eb92e132275274b72b09a52fc42aebfb66e0068eb815250815260200160405180604001604052807f15aa7fb602df2aef2504640ebe99a0eb203f1891304b2b9635618cbfc9b56b3481526020017f0b0d0c477afc716d17d46acfa3dda4638919ec8092570b87178955f2cad9fdfb815250815260200160405180604001604052807f23c3983ac2b053ff6cab78d798397f954174f60664bc127a0babe5cb4e85a9dc81526020017f305e217ed6d494f993fa931a22615957da6fd13bc9cae958ad4d3a48c7cbbf87815250815250815250600090601162002adf92919062002af4565b5034801562002aed57600080fd5b5062002c7e565b826011600e02810192821562002b39579160200282015b8281111562002b385782518290600762002b2792919062002b4c565b50916020019190600e019062002b0b565b5b50905062002b48919062002ba4565b5090565b826007600202810192821562002b91579160200282015b8281111562002b905782518290600262002b7f92919062002bcc565b509160200191906002019062002b63565b5b50905062002ba0919062002c11565b5090565b5b8082111562002bc8576000818162002bbe919062002c39565b50600e0162002ba5565b5090565b826002810192821562002bfe579160200282015b8281111562002bfd57825182559160200191906001019062002be0565b5b50905062002c0d919062002c51565b5090565b5b8082111562002c35576000818162002c2b919062002c70565b5060020162002c12565b5090565b50806007600202019062002c4e919062002c11565b50565b5b8082111562002c6c57600081600090555060010162002c52565b5090565b506000815560010160009055565b6120fd8062002c8e6000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80639aca8f2a14610030575b600080fd5b61004a60048036038101906100459190611b9d565b61004c565b005b61005584610cd9565b935061006083610cd9565b925061006a611a04565b6040518060400160405280846000600881106100af577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358152602001846001600881106100f3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013581525081600001819052506040518060400160405280604051806040016040528086600260088110610153577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135815260200186600360088110610197577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013581525081526020016040518060400160405280866004600881106101e9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002013581526020018660056008811061022d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358152508152508160200181905250604051806040016040528084600660088110610285577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200201358152602001846007600881106102c9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020020135815250816040018190525060006102f06010846102eb9190611fc8565b610d10565b905060008160800151600081518110610332577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905073ee44c1e83a768e80a3588b409f1a010f9d1dd7e86318c77c958273ee44c1e83a768e80a3588b409f1a010f9d1dd7e8636e1b699086608001516001815181106103af577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518e6040518363ffffffff1660e01b81526004016103d5929190611edb565b604080518083038186803b1580156103ec57600080fd5b505af4158015610400573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104249190611b74565b6040518363ffffffff1660e01b8152600401610441929190611eb2565b604080518083038186803b15801561045857600080fd5b505af415801561046c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104909190611b74565b905073ee44c1e83a768e80a3588b409f1a010f9d1dd7e86318c77c958273ee44c1e83a768e80a3588b409f1a010f9d1dd7e8636e1b69908660800151600281518110610505577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518d6040518363ffffffff1660e01b815260040161052b929190611edb565b604080518083038186803b15801561054257600080fd5b505af4158015610556573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057a9190611b74565b6040518363ffffffff1660e01b8152600401610597929190611eb2565b604080518083038186803b1580156105ae57600080fd5b505af41580156105c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e69190611b74565b905073ee44c1e83a768e80a3588b409f1a010f9d1dd7e86318c77c958273ee44c1e83a768e80a3588b409f1a010f9d1dd7e8636e1b6990866080015160038151811061065b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518c6040518363ffffffff1660e01b8152600401610681929190611edb565b604080518083038186803b15801561069857600080fd5b505af41580156106ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d09190611b74565b6040518363ffffffff1660e01b81526004016106ed929190611eb2565b604080518083038186803b15801561070457600080fd5b505af4158015610718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073c9190611b74565b905073ee44c1e83a768e80a3588b409f1a010f9d1dd7e86318c77c958273ee44c1e83a768e80a3588b409f1a010f9d1dd7e8636e1b699086608001516004815181106107b1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518b6040518363ffffffff1660e01b81526004016107d7929190611edb565b604080518083038186803b1580156107ee57600080fd5b505af4158015610802573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108269190611b74565b6040518363ffffffff1660e01b8152600401610843929190611eb2565b604080518083038186803b15801561085a57600080fd5b505af415801561086e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108929190611b74565b90506000600467ffffffffffffffff8111156108d7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561091057816020015b6108fd611a37565b8152602001906001900390816108f55790505b5090506000600467ffffffffffffffff811115610956577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561098f57816020015b61097c611a51565b8152602001906001900390816109745790505b50905073ee44c1e83a768e80a3588b409f1a010f9d1dd7e863a680077586600001516040518263ffffffff1660e01b81526004016109cd9190611e97565b604080518083038186803b1580156109e457600080fd5b505af41580156109f8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1c9190611b74565b82600081518110610a56577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250846020015181600081518110610aa0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250836000015182600181518110610aea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250836020015181600181518110610b34577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052508282600281518110610b7a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250836040015181600281518110610bc4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250846040015182600381518110610c0e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250836060015181600381518110610c58577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018190525073ee44c1e83a768e80a3588b409f1a010f9d1dd7e8632f3ed53983836040518363ffffffff1660e01b8152600401610c9c929190611e60565b60006040518083038186803b158015610cb457600080fd5b505af4158015610cc8573d6000803e3d6000fd5b505050505050505050505050505050565b6000600882604051602001610cee9190611e45565b6040516020818303038152906040528051906020012060001c901c9050919050565b610d18611a77565b610d20611a77565b60405180604001604052807f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281526020017f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19268152508160000181905250604051806040016040528060405180604001604052807f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c81526020017f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab815250815260200160405180604001604052807f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781526020017f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec88152508152508160200181905250604051806040016040528060405180604001604052807f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed815250815260200160405180604001604052807f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa8152508152508160400181905250604051806040016040528060008560118110610f4c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600060078110610f89577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60020201600280602002604051908101604052809291908260028015610fc4576020028201915b815481526020019060010190808311610fb0575b5050505050815260200160008560118110611008577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600160078110611045577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60020201600280602002604051908101604052809291908260028015611080576020028201915b81548152602001906001019080831161106c575b50505050508152508160600181905250600567ffffffffffffffff8111156110d1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561110a57816020015b6110f7611a37565b8152602001906001900390816110ef5790505b508160800181905250604051806040016040528060008560118110611158577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600260078110611195577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600202016000600281106111d2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b0154815260200160008560118110611213577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600260078110611250577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6002020160016002811061128d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b015481525081608001516000815181106112d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250604051806040016040528060008560118110611320577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e020160036007811061135d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6002020160006002811061139a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01548152602001600085601181106113db577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600360078110611418577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60020201600160028110611455577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01548152508160800151600181518110611498577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052506040518060400160405280600085601181106114e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600460078110611525577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60020201600060028110611562577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01548152602001600085601181106115a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e02016004600781106115e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6002020160016002811061161d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01548152508160800151600281518110611660577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052506040518060400160405280600085601181106116b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e02016005600781106116ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6002020160006002811061172a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b015481526020016000856011811061176b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e02016005600781106117a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600202016001600281106117e5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01548152508160800151600381518110611828577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250604051806040016040528060008560118110611878577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e02016006600781106118b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600202016000600281106118f2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b0154815260200160008560118110611933577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600e0201600660078110611970577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600202016001600281106119ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b015481525081608001516004815181106119f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018190525080915050919050565b6040518060600160405280611a17611a37565b8152602001611a24611a51565b8152602001611a31611a37565b81525090565b604051806040016040528060008152602001600081525090565b6040518060400160405280611a64611abe565b8152602001611a71611abe565b81525090565b6040518060a00160405280611a8a611a37565b8152602001611a97611a51565b8152602001611aa4611a51565b8152602001611ab1611a51565b8152602001606081525090565b6040518060400160405280600290602082028036833780820191505090505090565b600081905082602060080282011115611af857600080fd5b92915050565b600060408284031215611b1057600080fd5b611b1a6040611f04565b90506000611b2a84828501611b5f565b6000830152506020611b3e84828501611b5f565b60208301525092915050565b600081359050611b59816120b0565b92915050565b600081519050611b6e816120b0565b92915050565b600060408284031215611b8657600080fd5b6000611b9484828501611afe565b91505092915050565b6000806000806000806101a08789031215611bb757600080fd5b6000611bc589828a01611b4a565b9650506020611bd689828a01611b4a565b9550506040611be789828a01611b4a565b9450506060611bf889828a01611b4a565b9350506080611c0989828a01611ae0565b925050610180611c1b89828a01611b4a565b9150509295509295509295565b6000611c348383611db2565b60408301905092915050565b6000611c4c8383611de1565b60808301905092915050565b6000611c648383611e1f565b60208301905092915050565b6000611c7b82611f53565b611c858185611f9b565b9350611c9083611f29565b8060005b83811015611cc1578151611ca88882611c28565b9750611cb383611f74565b925050600181019050611c94565b5085935050505092915050565b6000611cd982611f5e565b611ce38185611fac565b9350611cee83611f39565b8060005b83811015611d1f578151611d068882611c40565b9750611d1183611f81565b925050600181019050611cf2565b5085935050505092915050565b611d3581611f69565b611d3f8184611fbd565b9250611d4a82611f49565b8060005b83811015611d7b578151611d628782611c58565b9650611d6d83611f8e565b925050600181019050611d4e565b505050505050565b604082016000820151611d996000850182611e1f565b506020820151611dac6020850182611e1f565b50505050565b604082016000820151611dc86000850182611e1f565b506020820151611ddb6020850182611e1f565b50505050565b608082016000820151611df76000850182611d2c565b506020820151611e0a6040850182611d2c565b50505050565b611e1981611ffc565b82525050565b611e2881611ffc565b82525050565b611e3f611e3a82611ffc565b612037565b82525050565b6000611e518284611e2e565b60208201915081905092915050565b60006040820190508181036000830152611e7a8185611c70565b90508181036020830152611e8e8184611cce565b90509392505050565b6000604082019050611eac6000830184611d83565b92915050565b6000608082019050611ec76000830185611d83565b611ed46040830184611d83565b9392505050565b6000606082019050611ef06000830185611d83565b611efd6040830184611e10565b9392505050565b6000611f0e611f1f565b9050611f1a8282612006565b919050565b6000604051905090565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050919050565b600081519050919050565b600081519050919050565b600060029050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000611fd382611ffc565b9150611fde83611ffc565b925082821015611ff157611ff0612041565b5b828203905092915050565b6000819050919050565b61200f8261209f565b810181811067ffffffffffffffff8211171561202e5761202d612070565b5b80604052505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6120b981611ffc565b81146120c457600080fd5b5056fea264697066735822122049226e24c63fabcd214f4fcddc85605421820e51f4bd721934f8d9fd921aa2d364736f6c63430008040033