diff --git a/apps/subgraph/abis/Semaphore.json b/apps/subgraph/abis/Semaphore.json index 23351783..082e4006 100644 --- a/apps/subgraph/abis/Semaphore.json +++ b/apps/subgraph/abis/Semaphore.json @@ -1,785 +1,799 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Semaphore", - "sourceName": "contracts/Semaphore.sol", - "abi": [ + "_format": "hh-sol-artifact-1", + "contractName": "Semaphore", + "sourceName": "contracts/Semaphore.sol", + "abi": [ + { + "inputs": [ { - "inputs": [ - { - "internalType": "contract ISemaphoreVerifier", - "name": "_verifier", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "LeafAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "LeafCannotBeZero", - "type": "error" - }, - { - "inputs": [], - "name": "LeafDoesNotExist", - "type": "error" - }, - { - "inputs": [], - "name": "LeafGreaterThanSnarkScalarField", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__CallerIsNotTheGroupAdmin", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__GroupAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__GroupDoesNotExist", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__GroupHasNoMembers", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__InvalidProof", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__MerkleTreeDepthIsNotSupported", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__MerkleTreeRootIsExpired", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__MerkleTreeRootIsNotPartOfTheGroup", - "type": "error" - }, - { - "inputs": [], - "name": "Semaphore__YouAreUsingTheSameNullifierTwice", - "type": "error" - }, - { - "inputs": [], - "name": "WrongSiblingNodes", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "oldAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "GroupAdminUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "oldMerkleTreeDuration", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newMerkleTreeDuration", - "type": "uint256" - } - ], - "name": "GroupMerkleTreeDurationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - } - ], - "name": "MemberAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - } - ], - "name": "MemberRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newIdentityCommitment", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - } - ], - "name": "MemberUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "startIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "identityCommitments", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - } - ], - "name": "MembersAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "merkleTreeDepth", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "message", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "scope", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256[8]", - "name": "proof", - "type": "uint256[8]" - } - ], - "name": "ProofValidated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - } - ], - "name": "addMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "identityCommitments", - "type": "uint256[]" - } - ], - "name": "addMembers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - }, - { - "internalType": "uint256", - "name": "merkleTreeDuration", - "type": "uint256" - } - ], - "name": "createGroup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "admin", - "type": "address" - } - ], - "name": "createGroup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "getMerkleTreeDepth", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "getMerkleTreeRoot", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "getMerkleTreeSize", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "groups", - "outputs": [ - { - "internalType": "uint256", - "name": "merkleTreeDuration", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - } - ], - "name": "hasMember", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - } - ], - "name": "indexOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "merkleProofSiblings", - "type": "uint256[]" - } - ], - "name": "removeMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "updateGroupAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newMerkleTreeDuration", - "type": "uint256" - } - ], - "name": "updateGroupMerkleTreeDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newIdentityCommitment", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "merkleProofSiblings", - "type": "uint256[]" - } - ], - "name": "updateMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "merkleTreeDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "message", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "scope", - "type": "uint256" - }, - { - "internalType": "uint256[8]", - "name": "proof", - "type": "uint256[8]" - } - ], - "name": "validateProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "verifier", - "outputs": [ - { - "internalType": "contract ISemaphoreVerifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "merkleTreeDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "message", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "scope", - "type": "uint256" - }, - { - "internalType": "uint256[8]", - "name": "proof", - "type": "uint256[8]" - } - ], - "name": "verifyProof", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b50604051620034ca380380620034ca8339818101604052810190620000379190620000fd565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200012f565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000b18262000084565b9050919050565b6000620000c582620000a4565b9050919050565b620000d781620000b8565b8114620000e357600080fd5b50565b600081519050620000f781620000cc565b92915050565b6000602082840312156200011657620001156200007f565b5b60006200012684828501620000e6565b91505092915050565b61338b806200013f6000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80636cdd32fe116100a257806396324bd41161007157806396324bd4146102c6578063b1805179146102f6578063c96e71fb14610312578063dabc4d511461032e578063fcf0b6ec1461035e5761010b565b80636cdd32fe1461021a5780637ee35a0c1461023657806390509d441461026657806393fef0fd146102965761010b565b80632b7ac3f3116100de5780632b7ac3f3146101945780634178c4d5146101b2578063568ee826146101ce5780636389e107146101ea5761010b565b8063042453711461011057806306dd84851461012c5780631783efc31461015c5780632694b47614610178575b600080fd5b61012a60048036038101906101259190612692565b61037a565b005b610146600480360381019061014191906126f2565b6103c4565b6040516101539190612741565b60405180910390f35b610176600480360381019061017191906126f2565b6103f2565b005b610192600480360381019061018d919061277e565b61043a565b005b61019c61060f565b6040516101a991906128a0565b60405180910390f35b6101cc60048036038101906101c791906128bb565b610635565b005b6101e860048036038101906101e39190612981565b610683565b005b61020460048036038101906101ff91906129c1565b610691565b6040516102119190612741565b60405180910390f35b610234600480360381019061022f91906129ee565b6106b0565b005b610250600480360381019061024b91906129c1565b6106fc565b60405161025d9190612741565b60405180910390f35b610280600480360381019061027b91906126f2565b61071b565b60405161028d9190612a7d565b60405180910390f35b6102b060048036038101906102ab919061277e565b610749565b6040516102bd9190612a7d565b60405180910390f35b6102e060048036038101906102db91906129c1565b610b57565b6040516102ed9190612741565b60405180910390f35b610310600480360381019061030b9190612a98565b610b75565b005b61032c60048036038101906103279190612981565b610b9f565b005b610348600480360381019061034391906129c1565b610bca565b6040516103559190612741565b60405180910390f35b610378600480360381019061037391906126f2565b610bed565b005b610385838383610d97565b600061039084610bca565b9050426003600086815260200190815260200160002060010160008381526020019081526020016000208190555050505050565b60006103ea82600080868152602001908152602001600020610e1390919063ffffffff16565b905092915050565b6103fc8282610e3f565b600061040783610bca565b90504260036000858152602001908152602001600020600101600083815260200190815260200160002081905550505050565b86600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036104d4576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60036000898152602001908152602001600020600201600086815260200190815260200160002060009054906101000a900460ff1615610540576040517f208b15e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61054f88888888888888610749565b610585576040517f4aa6bc4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600360008a8152602001908152602001600020600201600087815260200190815260200160002060006101000a81548160ff0219169083151502179055508286897f0c32e14cfe81a05d371c248d22de6b7ae849e981b76a1f8842e7b6da73fc405a8a8989886040516105fd9493929190612b05565b60405180910390a45050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106428585858585610feb565b600061064d86610bca565b90504260036000888152602001908152602001600020600101600083815260200190815260200160002081905550505050505050565b61068d82826111bd565b5050565b6000806000838152602001908152602001600020600101549050919050565b6106bc848484846113a3565b60006106c785610bca565b905042600360008781526020019081526020016000206001016000838152602001908152602001600020819055505050505050565b6000806000838152602001908152602001600020600001549050919050565b60006107418260008086815260200190815260200160002061157090919063ffffffff16565b905092915050565b600087600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036107e5576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018810806107f45750600c88115b1561082b576040517fecf64f1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108368a6106fc565b905060008103610872576040517fc8b02e0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061087d8b610bca565b905080891461094f576000600360008d815260200190815260200160002060010160008b81526020019081526020016000205490506000600360008e815260200190815260200160002060000154905060008203610907576040517f4d32958600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80826109139190612b7a565b42111561094c576040517f9581a99000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a23f01996040518060400160405280886000600881106109ac576109ab612bae565b5b60200201358152602001886001600881106109ca576109c9612bae565b5b6020020135815250604051806040016040528060405180604001604052808b6002600881106109fc576109fb612bae565b5b602002013581526020018b600360088110610a1a57610a19612bae565b5b6020020135815250815260200160405180604001604052808b600460088110610a4657610a45612bae565b5b602002013581526020018b600560088110610a6457610a63612bae565b5b602002013581525081525060405180604001604052808a600660088110610a8e57610a8d612bae565b5b602002013581526020018a600760088110610aac57610aab612bae565b5b602002013581525060405180608001604052808f81526020018e8152602001610ad48e611593565b8152602001610ae28d611593565b8152508f6040518663ffffffff1660e01b8152600401610b06959493929190612e0a565b602060405180830381865afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b479190612e8c565b9350505050979650505050505050565b60036020528060005260406000206000915090508060000154905081565b610b7f83836115ca565b806003600085815260200190815260200160002060000181905550505050565b610ba982826115ca565b610e1060036000848152602001908152602001600020600001819055505050565b6000610be6600080848152602001908152602001600020611742565b9050919050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610c87576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d20576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060036000868152602001908152602001600020600001549050836003600087815260200190815260200160002060000181905550847f264b2a8f6763c084235fe832ba903482b2ef1a521336881fc75b987c2dfd29c58286604051610d88929190612eb9565b60405180910390a25050505050565b6000610da2846106fc565b90506000610dcc84846000808981526020019081526020016000206117659092919063ffffffff16565b9050847f61e5e8054e3daf084a0c6c646c065e8bf5e7ca4d5567bda942309bd1652f349d83868685604051610e049493929190612f54565b60405180910390a25050505050565b6000600183600301600084815260200190815260200160002054610e379190612f94565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ed9576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f72576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610f7d856106fc565b90506000610fa585600080898152602001908152602001600020611d6290919063ffffffff16565b9050857f19239b3f93cd10558aaf11423af70c77763bf54f52bcc75bfa74d4d13548cde9838784604051610fdb93929190612fc8565b60405180910390a2505050505050565b84600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611085576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461111e576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611144876000808b8152602001908152602001600020610e1390919063ffffffff16565b90506000611172888888886000808f8152602001908152602001600020611fde90949392919063ffffffff16565b9050887fea3588e4a2a0c93d6a0e69dfeaf7496f43ccccf02ad9ce0a5b7627cbca4b61b1838a8a856040516111aa9493929190612fff565b60405180910390a2505050505050505050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611257576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112f0576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16857f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a450505050565b83600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361143d576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b843373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d6576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006114fc866000808a8152602001908152602001600020610e1390919063ffffffff16565b905060006115288787876000808d81526020019081526020016000206125d3909392919063ffffffff16565b9050877f3108849c053c77b8073a11256dffb5ffd5b55e93e105a355e1c9061db890d87183898460405161155e93929190612fc8565b60405180910390a25050505050505050565b600080836003016000848152602001908152602001600020541415905092915050565b60006008826040516020016115a89190613065565b6040516020818303038152906040528051906020012060001c901c9050919050565b600073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611663576040517f8121725b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550817ff0adfb94eab6daf835deb69c5738fe636150c3dfd08094a76f39b963dc8cb05a60405160405180910390a28073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff16837f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a45050565b600081600201600083600101548152602001908152602001600020549050919050565b600080600090505b838390508110156118f0577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018484838181106117ac576117ab612bae565b5b90506020020135106117ea576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008484838181106117ff576117fe612bae565b5b905060200201350361183d576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118608585858481811061185457611853612bae565b5b90506020020135611570565b15611897576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600186600001546118a99190612b7a565b6118b39190612b7a565b8560030160008686858181106118cc576118cb612bae565b5b9050602002013581526020019081526020016000208190555080600101905061176d565b506060838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505090505b83839050856000015461194b9190612b7a565b8560010154600261195c91906131b3565b10156119835760018560010160008282546119779190612b7a565b92505081905550611938565b60008560000154905060008585905087600001546119a19190612b7a565b90506000600183901c905060006001806001856119be9190612f94565b901c6119ca9190612b7a565b905060005b8960010154811015611ce057600083836119e99190612f94565b905060008167ffffffffffffffff811115611a0757611a066131fe565b5b604051908082528060200260200182016040528015611a355781602001602082028036833780820191505090505b50905060005b82811015611c075760008088600160028a86611a579190612b7a565b611a61919061322d565b611a6b9190612b7a565b1015611abd578a8a600160028b87611a839190612b7a565b611a8d919061322d565b611a979190612b7a565b611aa19190612f94565b81518110611ab257611ab1612bae565b5b602002602001015191505b8960028985611acc9190612b7a565b611ad6919061322d565b1015611af9578e6002016000878152602001908152602001600020549050611b39565b8a8a60028a86611b099190612b7a565b611b13919061322d565b611b1d9190612f94565b81518110611b2e57611b2d612bae565b5b602002602001015190505b6000808314611bd55773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280858152602001868152506040518263ffffffff1660e01b8152600401611b8d91906132f8565b602060405180830381865af4158015611baa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bce9190613328565b9050611bd9565b8190505b80858581518110611bed57611bec612bae565b5b602002602001018181525050836001019350505050611a3b565b50600180871603611c58578760018951611c219190612f94565b81518110611c3257611c31612bae565b5b60200260200101518c600201600085815260200190815260200160002081905550611ca5565b600188511115611ca4578760028951611c719190612f94565b81518110611c8257611c81612bae565b5b60200260200101518c6002016000858152602001908152602001600020819055505b5b849650600185901c9450809750839550600180600186611cc59190612f94565b901c611cd19190612b7a565b935082600101925050506119cf565b5087879050896000016000828254611cf89190612b7a565b9250508190555084600081518110611d1357611d12612bae565b5b60200260200101518960020160008b6001015481526020019081526020016000208190555084600081518110611d4c57611d4b612bae565b5b6020026020010151955050505050509392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018210611dbd576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008203611df7576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e018383611570565b15611e38576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b60018360000154611e4a9190612b7a565b83600101546002611e5b91906131b3565b1015611e82576001836001016000828254611e769190612b7a565b92505081905550611e39565b600083600001549050600083905060005b8560010154811015611f7a576001808285901c1603611f545773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280896002016000868152602001908152602001600020548152602001858152506040518263ffffffff1660e01b8152600401611f0c91906132f8565b602060405180830381865af4158015611f29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4d9190613328565b9150611f6f565b81866002016000838152602001908152602001600020819055505b806001019050611e93565b506001856000016000828254611f909190612b7a565b92505081905550808560020160008760010154815260200190815260200160002081905550846000015485600301600086815260200190815260200160002081905550809250505092915050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018410612039576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120438686611570565b612079576040517f7204756c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008414158015612090575061208f8685611570565b5b156120c7576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008383905003612104576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006121108787610e13565b905060008590506000879050600060018a6000015461212f9190612f94565b90506000805b8b60010154811015612518576001808288901c1603612319577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000189898481811061218257612181612bae565b5b90506020020135106121c0576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c878181106121f8576121f7612bae565b5b905060200201358152602001888152506040518263ffffffff1660e01b815260040161222491906132f8565b602060405180830381865af4158015612241573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122659190613328565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c8781811061229f5761229e612bae565b5b905060200201358152602001878152506040518263ffffffff1660e01b81526004016122cb91906132f8565b602060405180830381865af41580156122e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230c9190613328565b935081600101915061250d565b8083901c8187901c146124f1577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000189898481811061235a57612359612bae565b5b9050602002013510612398576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808881526020018c8c878181106123d6576123d5612bae565b5b905060200201358152506040518263ffffffff1660e01b81526004016123fc91906132f8565b602060405180830381865af4158015612419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061243d9190613328565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808781526020018c8c8781811061247d5761247c612bae565b5b905060200201358152506040518263ffffffff1660e01b81526004016124a391906132f8565b602060405180830381865af41580156124c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e49190613328565b935081600101915061250c565b848c6002016000848152602001908152602001600020819055505b5b806001019050612135565b506125228b611742565b831461255a576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838b60020160008d600101548152602001908152602001600020819055508a60030160008b8152602001908152602001600020548b60030160008b81526020019081526020016000208190555060008b60030160008c815260200190815260200160002081905550839550505050505095945050505050565b60006125e3858560008686611fde565b9050949350505050565b600080fd5b600080fd5b6000819050919050565b61260a816125f7565b811461261557600080fd5b50565b60008135905061262781612601565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126126525761265161262d565b5b8235905067ffffffffffffffff81111561266f5761266e612632565b5b60208301915083602082028301111561268b5761268a612637565b5b9250929050565b6000806000604084860312156126ab576126aa6125ed565b5b60006126b986828701612618565b935050602084013567ffffffffffffffff8111156126da576126d96125f2565b5b6126e68682870161263c565b92509250509250925092565b60008060408385031215612709576127086125ed565b5b600061271785828601612618565b925050602061272885828601612618565b9150509250929050565b61273b816125f7565b82525050565b60006020820190506127566000830184612732565b92915050565b60008190508260206008028201111561277857612777612637565b5b92915050565b60008060008060008060006101c0888a03121561279e5761279d6125ed565b5b60006127ac8a828b01612618565b97505060206127bd8a828b01612618565b96505060406127ce8a828b01612618565b95505060606127df8a828b01612618565b94505060806127f08a828b01612618565b93505060a06128018a828b01612618565b92505060c06128128a828b0161275c565b91505092959891949750929550565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061286661286161285c84612821565b612841565b612821565b9050919050565b60006128788261284b565b9050919050565b600061288a8261286d565b9050919050565b61289a8161287f565b82525050565b60006020820190506128b56000830184612891565b92915050565b6000806000806000608086880312156128d7576128d66125ed565b5b60006128e588828901612618565b95505060206128f688828901612618565b945050604061290788828901612618565b935050606086013567ffffffffffffffff811115612928576129276125f2565b5b6129348882890161263c565b92509250509295509295909350565b600061294e82612821565b9050919050565b61295e81612943565b811461296957600080fd5b50565b60008135905061297b81612955565b92915050565b60008060408385031215612998576129976125ed565b5b60006129a685828601612618565b92505060206129b78582860161296c565b9150509250929050565b6000602082840312156129d7576129d66125ed565b5b60006129e584828501612618565b91505092915050565b60008060008060608587031215612a0857612a076125ed565b5b6000612a1687828801612618565b9450506020612a2787828801612618565b935050604085013567ffffffffffffffff811115612a4857612a476125f2565b5b612a548782880161263c565b925092505092959194509250565b60008115159050919050565b612a7781612a62565b82525050565b6000602082019050612a926000830184612a6e565b92915050565b600080600060608486031215612ab157612ab06125ed565b5b6000612abf86828701612618565b9350506020612ad08682870161296c565b9250506040612ae186828701612618565b9150509250925092565b82818337505050565b612b016101008383612aeb565b5050565b600061016082019050612b1b6000830187612732565b612b286020830186612732565b612b356040830185612732565b612b426060830184612af4565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612b85826125f7565b9150612b90836125f7565b9250828201905080821115612ba857612ba7612b4b565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060029050919050565b600081905092915050565b6000819050919050565b612c06816125f7565b82525050565b6000612c188383612bfd565b60208301905092915050565b6000602082019050919050565b612c3a81612bdd565b612c448184612be8565b9250612c4f82612bf3565b8060005b83811015612c80578151612c678782612c0c565b9650612c7283612c24565b925050600181019050612c53565b505050505050565b600060029050919050565b600081905092915050565b6000819050919050565b600081905092915050565b612cbc81612bdd565b612cc68184612ca8565b9250612cd182612bf3565b8060005b83811015612d02578151612ce98782612c0c565b9650612cf483612c24565b925050600181019050612cd5565b505050505050565b6000612d168383612cb3565b60408301905092915050565b6000602082019050919050565b612d3881612c88565b612d428184612c93565b9250612d4d82612c9e565b8060005b83811015612d7e578151612d658782612d0a565b9650612d7083612d22565b925050600181019050612d51565b505050505050565b600060049050919050565b600081905092915050565b6000819050919050565b6000602082019050919050565b612dbc81612d86565b612dc68184612d91565b9250612dd182612d9c565b8060005b83811015612e02578151612de98782612c0c565b9650612df483612da6565b925050600181019050612dd5565b505050505050565b60006101a082019050612e206000830188612c31565b612e2d6040830187612d2f565b612e3a60c0830186612c31565b612e48610100830185612db3565b612e56610180830184612732565b9695505050505050565b612e6981612a62565b8114612e7457600080fd5b50565b600081519050612e8681612e60565b92915050565b600060208284031215612ea257612ea16125ed565b5b6000612eb084828501612e77565b91505092915050565b6000604082019050612ece6000830185612732565b612edb6020830184612732565b9392505050565b600082825260208201905092915050565b600080fd5b6000612f048385612ee2565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612f3757612f36612ef3565b5b602083029250612f48838584612aeb565b82840190509392505050565b6000606082019050612f696000830187612732565b8181036020830152612f7c818587612ef8565b9050612f8b6040830184612732565b95945050505050565b6000612f9f826125f7565b9150612faa836125f7565b9250828203905081811115612fc257612fc1612b4b565b5b92915050565b6000606082019050612fdd6000830186612732565b612fea6020830185612732565b612ff76040830184612732565b949350505050565b60006080820190506130146000830187612732565b6130216020830186612732565b61302e6040830185612732565b61303b6060830184612732565b95945050505050565b6000819050919050565b61305f61305a826125f7565b613044565b82525050565b6000613071828461304e565b60208201915081905092915050565b60008160011c9050919050565b6000808291508390505b60018511156130d7578086048111156130b3576130b2612b4b565b5b60018516156130c25780820291505b80810290506130d085613080565b9450613097565b94509492505050565b6000826130f057600190506131ac565b816130fe57600090506131ac565b8160018114613114576002811461311e5761314d565b60019150506131ac565b60ff8411156131305761312f612b4b565b5b8360020a91508482111561314757613146612b4b565b5b506131ac565b5060208310610133831016604e8410600b84101617156131825782820a90508381111561317d5761317c612b4b565b5b6131ac565b61318f848484600161308d565b925090508184048111156131a6576131a5612b4b565b5b81810290505b9392505050565b60006131be826125f7565b91506131c9836125f7565b92506131f67fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846130e0565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000613238826125f7565b9150613243836125f7565b9250828202613251816125f7565b9150828204841483151761326857613267612b4b565b5b5092915050565b600081905092915050565b613283816125f7565b82525050565b6000613295838361327a565b60208301905092915050565b6132aa81612bdd565b6132b4818461326f565b92506132bf82612bf3565b8060005b838110156132f05781516132d78782613289565b96506132e283612c24565b9250506001810190506132c3565b505050505050565b600060408201905061330d60008301846132a1565b92915050565b60008151905061332281612601565b92915050565b60006020828403121561333e5761333d6125ed565b5b600061334c84828501613313565b9150509291505056fea2646970667358221220bd467153adedb957571d77cab89a394e556c77ecdc723bd448dffda8c0bf8a2264736f6c63430008170033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80636cdd32fe116100a257806396324bd41161007157806396324bd4146102c6578063b1805179146102f6578063c96e71fb14610312578063dabc4d511461032e578063fcf0b6ec1461035e5761010b565b80636cdd32fe1461021a5780637ee35a0c1461023657806390509d441461026657806393fef0fd146102965761010b565b80632b7ac3f3116100de5780632b7ac3f3146101945780634178c4d5146101b2578063568ee826146101ce5780636389e107146101ea5761010b565b8063042453711461011057806306dd84851461012c5780631783efc31461015c5780632694b47614610178575b600080fd5b61012a60048036038101906101259190612692565b61037a565b005b610146600480360381019061014191906126f2565b6103c4565b6040516101539190612741565b60405180910390f35b610176600480360381019061017191906126f2565b6103f2565b005b610192600480360381019061018d919061277e565b61043a565b005b61019c61060f565b6040516101a991906128a0565b60405180910390f35b6101cc60048036038101906101c791906128bb565b610635565b005b6101e860048036038101906101e39190612981565b610683565b005b61020460048036038101906101ff91906129c1565b610691565b6040516102119190612741565b60405180910390f35b610234600480360381019061022f91906129ee565b6106b0565b005b610250600480360381019061024b91906129c1565b6106fc565b60405161025d9190612741565b60405180910390f35b610280600480360381019061027b91906126f2565b61071b565b60405161028d9190612a7d565b60405180910390f35b6102b060048036038101906102ab919061277e565b610749565b6040516102bd9190612a7d565b60405180910390f35b6102e060048036038101906102db91906129c1565b610b57565b6040516102ed9190612741565b60405180910390f35b610310600480360381019061030b9190612a98565b610b75565b005b61032c60048036038101906103279190612981565b610b9f565b005b610348600480360381019061034391906129c1565b610bca565b6040516103559190612741565b60405180910390f35b610378600480360381019061037391906126f2565b610bed565b005b610385838383610d97565b600061039084610bca565b9050426003600086815260200190815260200160002060010160008381526020019081526020016000208190555050505050565b60006103ea82600080868152602001908152602001600020610e1390919063ffffffff16565b905092915050565b6103fc8282610e3f565b600061040783610bca565b90504260036000858152602001908152602001600020600101600083815260200190815260200160002081905550505050565b86600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036104d4576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60036000898152602001908152602001600020600201600086815260200190815260200160002060009054906101000a900460ff1615610540576040517f208b15e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61054f88888888888888610749565b610585576040517f4aa6bc4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600360008a8152602001908152602001600020600201600087815260200190815260200160002060006101000a81548160ff0219169083151502179055508286897f0c32e14cfe81a05d371c248d22de6b7ae849e981b76a1f8842e7b6da73fc405a8a8989886040516105fd9493929190612b05565b60405180910390a45050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106428585858585610feb565b600061064d86610bca565b90504260036000888152602001908152602001600020600101600083815260200190815260200160002081905550505050505050565b61068d82826111bd565b5050565b6000806000838152602001908152602001600020600101549050919050565b6106bc848484846113a3565b60006106c785610bca565b905042600360008781526020019081526020016000206001016000838152602001908152602001600020819055505050505050565b6000806000838152602001908152602001600020600001549050919050565b60006107418260008086815260200190815260200160002061157090919063ffffffff16565b905092915050565b600087600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036107e5576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018810806107f45750600c88115b1561082b576040517fecf64f1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108368a6106fc565b905060008103610872576040517fc8b02e0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061087d8b610bca565b905080891461094f576000600360008d815260200190815260200160002060010160008b81526020019081526020016000205490506000600360008e815260200190815260200160002060000154905060008203610907576040517f4d32958600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80826109139190612b7a565b42111561094c576040517f9581a99000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a23f01996040518060400160405280886000600881106109ac576109ab612bae565b5b60200201358152602001886001600881106109ca576109c9612bae565b5b6020020135815250604051806040016040528060405180604001604052808b6002600881106109fc576109fb612bae565b5b602002013581526020018b600360088110610a1a57610a19612bae565b5b6020020135815250815260200160405180604001604052808b600460088110610a4657610a45612bae565b5b602002013581526020018b600560088110610a6457610a63612bae565b5b602002013581525081525060405180604001604052808a600660088110610a8e57610a8d612bae565b5b602002013581526020018a600760088110610aac57610aab612bae565b5b602002013581525060405180608001604052808f81526020018e8152602001610ad48e611593565b8152602001610ae28d611593565b8152508f6040518663ffffffff1660e01b8152600401610b06959493929190612e0a565b602060405180830381865afa158015610b23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b479190612e8c565b9350505050979650505050505050565b60036020528060005260406000206000915090508060000154905081565b610b7f83836115ca565b806003600085815260200190815260200160002060000181905550505050565b610ba982826115ca565b610e1060036000848152602001908152602001600020600001819055505050565b6000610be6600080848152602001908152602001600020611742565b9050919050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610c87576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d20576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060036000868152602001908152602001600020600001549050836003600087815260200190815260200160002060000181905550847f264b2a8f6763c084235fe832ba903482b2ef1a521336881fc75b987c2dfd29c58286604051610d88929190612eb9565b60405180910390a25050505050565b6000610da2846106fc565b90506000610dcc84846000808981526020019081526020016000206117659092919063ffffffff16565b9050847f61e5e8054e3daf084a0c6c646c065e8bf5e7ca4d5567bda942309bd1652f349d83868685604051610e049493929190612f54565b60405180910390a25050505050565b6000600183600301600084815260200190815260200160002054610e379190612f94565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ed9576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f72576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610f7d856106fc565b90506000610fa585600080898152602001908152602001600020611d6290919063ffffffff16565b9050857f19239b3f93cd10558aaf11423af70c77763bf54f52bcc75bfa74d4d13548cde9838784604051610fdb93929190612fc8565b60405180910390a2505050505050565b84600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611085576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461111e576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611144876000808b8152602001908152602001600020610e1390919063ffffffff16565b90506000611172888888886000808f8152602001908152602001600020611fde90949392919063ffffffff16565b9050887fea3588e4a2a0c93d6a0e69dfeaf7496f43ccccf02ad9ce0a5b7627cbca4b61b1838a8a856040516111aa9493929190612fff565b60405180910390a2505050505050505050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611257576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112f0576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16857f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a450505050565b83600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361143d576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b843373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d6576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006114fc866000808a8152602001908152602001600020610e1390919063ffffffff16565b905060006115288787876000808d81526020019081526020016000206125d3909392919063ffffffff16565b9050877f3108849c053c77b8073a11256dffb5ffd5b55e93e105a355e1c9061db890d87183898460405161155e93929190612fc8565b60405180910390a25050505050505050565b600080836003016000848152602001908152602001600020541415905092915050565b60006008826040516020016115a89190613065565b6040516020818303038152906040528051906020012060001c901c9050919050565b600073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611663576040517f8121725b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550817ff0adfb94eab6daf835deb69c5738fe636150c3dfd08094a76f39b963dc8cb05a60405160405180910390a28073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff16837f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a45050565b600081600201600083600101548152602001908152602001600020549050919050565b600080600090505b838390508110156118f0577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018484838181106117ac576117ab612bae565b5b90506020020135106117ea576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008484838181106117ff576117fe612bae565b5b905060200201350361183d576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118608585858481811061185457611853612bae565b5b90506020020135611570565b15611897576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600186600001546118a99190612b7a565b6118b39190612b7a565b8560030160008686858181106118cc576118cb612bae565b5b9050602002013581526020019081526020016000208190555080600101905061176d565b506060838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505090505b83839050856000015461194b9190612b7a565b8560010154600261195c91906131b3565b10156119835760018560010160008282546119779190612b7a565b92505081905550611938565b60008560000154905060008585905087600001546119a19190612b7a565b90506000600183901c905060006001806001856119be9190612f94565b901c6119ca9190612b7a565b905060005b8960010154811015611ce057600083836119e99190612f94565b905060008167ffffffffffffffff811115611a0757611a066131fe565b5b604051908082528060200260200182016040528015611a355781602001602082028036833780820191505090505b50905060005b82811015611c075760008088600160028a86611a579190612b7a565b611a61919061322d565b611a6b9190612b7a565b1015611abd578a8a600160028b87611a839190612b7a565b611a8d919061322d565b611a979190612b7a565b611aa19190612f94565b81518110611ab257611ab1612bae565b5b602002602001015191505b8960028985611acc9190612b7a565b611ad6919061322d565b1015611af9578e6002016000878152602001908152602001600020549050611b39565b8a8a60028a86611b099190612b7a565b611b13919061322d565b611b1d9190612f94565b81518110611b2e57611b2d612bae565b5b602002602001015190505b6000808314611bd55773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280858152602001868152506040518263ffffffff1660e01b8152600401611b8d91906132f8565b602060405180830381865af4158015611baa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bce9190613328565b9050611bd9565b8190505b80858581518110611bed57611bec612bae565b5b602002602001018181525050836001019350505050611a3b565b50600180871603611c58578760018951611c219190612f94565b81518110611c3257611c31612bae565b5b60200260200101518c600201600085815260200190815260200160002081905550611ca5565b600188511115611ca4578760028951611c719190612f94565b81518110611c8257611c81612bae565b5b60200260200101518c6002016000858152602001908152602001600020819055505b5b849650600185901c9450809750839550600180600186611cc59190612f94565b901c611cd19190612b7a565b935082600101925050506119cf565b5087879050896000016000828254611cf89190612b7a565b9250508190555084600081518110611d1357611d12612bae565b5b60200260200101518960020160008b6001015481526020019081526020016000208190555084600081518110611d4c57611d4b612bae565b5b6020026020010151955050505050509392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018210611dbd576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008203611df7576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e018383611570565b15611e38576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b60018360000154611e4a9190612b7a565b83600101546002611e5b91906131b3565b1015611e82576001836001016000828254611e769190612b7a565b92505081905550611e39565b600083600001549050600083905060005b8560010154811015611f7a576001808285901c1603611f545773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280896002016000868152602001908152602001600020548152602001858152506040518263ffffffff1660e01b8152600401611f0c91906132f8565b602060405180830381865af4158015611f29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4d9190613328565b9150611f6f565b81866002016000838152602001908152602001600020819055505b806001019050611e93565b506001856000016000828254611f909190612b7a565b92505081905550808560020160008760010154815260200190815260200160002081905550846000015485600301600086815260200190815260200160002081905550809250505092915050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018410612039576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120438686611570565b612079576040517f7204756c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008414158015612090575061208f8685611570565b5b156120c7576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008383905003612104576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006121108787610e13565b905060008590506000879050600060018a6000015461212f9190612f94565b90506000805b8b60010154811015612518576001808288901c1603612319577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000189898481811061218257612181612bae565b5b90506020020135106121c0576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c878181106121f8576121f7612bae565b5b905060200201358152602001888152506040518263ffffffff1660e01b815260040161222491906132f8565b602060405180830381865af4158015612241573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122659190613328565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c8781811061229f5761229e612bae565b5b905060200201358152602001878152506040518263ffffffff1660e01b81526004016122cb91906132f8565b602060405180830381865af41580156122e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230c9190613328565b935081600101915061250d565b8083901c8187901c146124f1577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000189898481811061235a57612359612bae565b5b9050602002013510612398576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808881526020018c8c878181106123d6576123d5612bae565b5b905060200201358152506040518263ffffffff1660e01b81526004016123fc91906132f8565b602060405180830381865af4158015612419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061243d9190613328565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808781526020018c8c8781811061247d5761247c612bae565b5b905060200201358152506040518263ffffffff1660e01b81526004016124a391906132f8565b602060405180830381865af41580156124c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124e49190613328565b935081600101915061250c565b848c6002016000848152602001908152602001600020819055505b5b806001019050612135565b506125228b611742565b831461255a576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838b60020160008d600101548152602001908152602001600020819055508a60030160008b8152602001908152602001600020548b60030160008b81526020019081526020016000208190555060008b60030160008c815260200190815260200160002081905550839550505050505095945050505050565b60006125e3858560008686611fde565b9050949350505050565b600080fd5b600080fd5b6000819050919050565b61260a816125f7565b811461261557600080fd5b50565b60008135905061262781612601565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126126525761265161262d565b5b8235905067ffffffffffffffff81111561266f5761266e612632565b5b60208301915083602082028301111561268b5761268a612637565b5b9250929050565b6000806000604084860312156126ab576126aa6125ed565b5b60006126b986828701612618565b935050602084013567ffffffffffffffff8111156126da576126d96125f2565b5b6126e68682870161263c565b92509250509250925092565b60008060408385031215612709576127086125ed565b5b600061271785828601612618565b925050602061272885828601612618565b9150509250929050565b61273b816125f7565b82525050565b60006020820190506127566000830184612732565b92915050565b60008190508260206008028201111561277857612777612637565b5b92915050565b60008060008060008060006101c0888a03121561279e5761279d6125ed565b5b60006127ac8a828b01612618565b97505060206127bd8a828b01612618565b96505060406127ce8a828b01612618565b95505060606127df8a828b01612618565b94505060806127f08a828b01612618565b93505060a06128018a828b01612618565b92505060c06128128a828b0161275c565b91505092959891949750929550565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061286661286161285c84612821565b612841565b612821565b9050919050565b60006128788261284b565b9050919050565b600061288a8261286d565b9050919050565b61289a8161287f565b82525050565b60006020820190506128b56000830184612891565b92915050565b6000806000806000608086880312156128d7576128d66125ed565b5b60006128e588828901612618565b95505060206128f688828901612618565b945050604061290788828901612618565b935050606086013567ffffffffffffffff811115612928576129276125f2565b5b6129348882890161263c565b92509250509295509295909350565b600061294e82612821565b9050919050565b61295e81612943565b811461296957600080fd5b50565b60008135905061297b81612955565b92915050565b60008060408385031215612998576129976125ed565b5b60006129a685828601612618565b92505060206129b78582860161296c565b9150509250929050565b6000602082840312156129d7576129d66125ed565b5b60006129e584828501612618565b91505092915050565b60008060008060608587031215612a0857612a076125ed565b5b6000612a1687828801612618565b9450506020612a2787828801612618565b935050604085013567ffffffffffffffff811115612a4857612a476125f2565b5b612a548782880161263c565b925092505092959194509250565b60008115159050919050565b612a7781612a62565b82525050565b6000602082019050612a926000830184612a6e565b92915050565b600080600060608486031215612ab157612ab06125ed565b5b6000612abf86828701612618565b9350506020612ad08682870161296c565b9250506040612ae186828701612618565b9150509250925092565b82818337505050565b612b016101008383612aeb565b5050565b600061016082019050612b1b6000830187612732565b612b286020830186612732565b612b356040830185612732565b612b426060830184612af4565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612b85826125f7565b9150612b90836125f7565b9250828201905080821115612ba857612ba7612b4b565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060029050919050565b600081905092915050565b6000819050919050565b612c06816125f7565b82525050565b6000612c188383612bfd565b60208301905092915050565b6000602082019050919050565b612c3a81612bdd565b612c448184612be8565b9250612c4f82612bf3565b8060005b83811015612c80578151612c678782612c0c565b9650612c7283612c24565b925050600181019050612c53565b505050505050565b600060029050919050565b600081905092915050565b6000819050919050565b600081905092915050565b612cbc81612bdd565b612cc68184612ca8565b9250612cd182612bf3565b8060005b83811015612d02578151612ce98782612c0c565b9650612cf483612c24565b925050600181019050612cd5565b505050505050565b6000612d168383612cb3565b60408301905092915050565b6000602082019050919050565b612d3881612c88565b612d428184612c93565b9250612d4d82612c9e565b8060005b83811015612d7e578151612d658782612d0a565b9650612d7083612d22565b925050600181019050612d51565b505050505050565b600060049050919050565b600081905092915050565b6000819050919050565b6000602082019050919050565b612dbc81612d86565b612dc68184612d91565b9250612dd182612d9c565b8060005b83811015612e02578151612de98782612c0c565b9650612df483612da6565b925050600181019050612dd5565b505050505050565b60006101a082019050612e206000830188612c31565b612e2d6040830187612d2f565b612e3a60c0830186612c31565b612e48610100830185612db3565b612e56610180830184612732565b9695505050505050565b612e6981612a62565b8114612e7457600080fd5b50565b600081519050612e8681612e60565b92915050565b600060208284031215612ea257612ea16125ed565b5b6000612eb084828501612e77565b91505092915050565b6000604082019050612ece6000830185612732565b612edb6020830184612732565b9392505050565b600082825260208201905092915050565b600080fd5b6000612f048385612ee2565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612f3757612f36612ef3565b5b602083029250612f48838584612aeb565b82840190509392505050565b6000606082019050612f696000830187612732565b8181036020830152612f7c818587612ef8565b9050612f8b6040830184612732565b95945050505050565b6000612f9f826125f7565b9150612faa836125f7565b9250828203905081811115612fc257612fc1612b4b565b5b92915050565b6000606082019050612fdd6000830186612732565b612fea6020830185612732565b612ff76040830184612732565b949350505050565b60006080820190506130146000830187612732565b6130216020830186612732565b61302e6040830185612732565b61303b6060830184612732565b95945050505050565b6000819050919050565b61305f61305a826125f7565b613044565b82525050565b6000613071828461304e565b60208201915081905092915050565b60008160011c9050919050565b6000808291508390505b60018511156130d7578086048111156130b3576130b2612b4b565b5b60018516156130c25780820291505b80810290506130d085613080565b9450613097565b94509492505050565b6000826130f057600190506131ac565b816130fe57600090506131ac565b8160018114613114576002811461311e5761314d565b60019150506131ac565b60ff8411156131305761312f612b4b565b5b8360020a91508482111561314757613146612b4b565b5b506131ac565b5060208310610133831016604e8410600b84101617156131825782820a90508381111561317d5761317c612b4b565b5b6131ac565b61318f848484600161308d565b925090508184048111156131a6576131a5612b4b565b5b81810290505b9392505050565b60006131be826125f7565b91506131c9836125f7565b92506131f67fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846130e0565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000613238826125f7565b9150613243836125f7565b9250828202613251816125f7565b9150828204841483151761326857613267612b4b565b5b5092915050565b600081905092915050565b613283816125f7565b82525050565b6000613295838361327a565b60208301905092915050565b6132aa81612bdd565b6132b4818461326f565b92506132bf82612bf3565b8060005b838110156132f05781516132d78782613289565b96506132e283612c24565b9250506001810190506132c3565b505050505050565b600060408201905061330d60008301846132a1565b92915050565b60008151905061332281612601565b92915050565b60006020828403121561333e5761333d6125ed565b5b600061334c84828501613313565b9150509291505056fea2646970667358221220bd467153adedb957571d77cab89a394e556c77ecdc723bd448dffda8c0bf8a2264736f6c63430008170033", - "linkReferences": { - "poseidon-solidity/PoseidonT3.sol": { - "PoseidonT3": [ - { - "length": 20, - "start": 7299 - }, - { - "length": 20, - "start": 8173 - }, - { - "length": 20, - "start": 8961 - }, - { - "length": 20, - "start": 9128 - }, - { - "length": 20, - "start": 9433 - }, - { - "length": 20, - "start": 9600 - } - ] + "internalType": "contract ISemaphoreVerifier", + "name": "_verifier", + "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" }, - "deployedLinkReferences": { - "poseidon-solidity/PoseidonT3.sol": { - "PoseidonT3": [ - { - "length": 20, - "start": 6980 - }, - { - "length": 20, - "start": 7854 - }, - { - "length": 20, - "start": 8642 - }, - { - "length": 20, - "start": 8809 - }, - { - "length": 20, - "start": 9114 - }, - { - "length": 20, - "start": 9281 - } - ] + { + "inputs": [], + "name": "LeafAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LeafCannotBeZero", + "type": "error" + }, + { + "inputs": [], + "name": "LeafDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "LeafGreaterThanSnarkScalarField", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__CallerIsNotTheGroupAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__GroupAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__GroupDoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__GroupHasNoMembers", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__InvalidProof", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__MerkleTreeDepthIsNotSupported", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__MerkleTreeRootIsExpired", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__MerkleTreeRootIsNotPartOfTheGroup", + "type": "error" + }, + { + "inputs": [], + "name": "Semaphore__YouAreUsingTheSameNullifierTwice", + "type": "error" + }, + { + "inputs": [], + "name": "WrongSiblingNodes", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" } + ], + "name": "GroupAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + } + ], + "name": "GroupCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMerkleTreeDuration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMerkleTreeDuration", + "type": "uint256" + } + ], + "name": "GroupMerkleTreeDurationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + } + ], + "name": "MemberAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + } + ], + "name": "MemberRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIdentityCommitment", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + } + ], + "name": "MemberUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "identityCommitments", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + } + ], + "name": "MembersAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "merkleTreeDepth", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nullifier", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "message", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "scope", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[8]", + "name": "points", + "type": "uint256[8]" + } + ], + "name": "ProofValidated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + } + ], + "name": "addMember", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "identityCommitments", + "type": "uint256[]" + } + ], + "name": "addMembers", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "uint256", + "name": "merkleTreeDuration", + "type": "uint256" + } + ], + "name": "createGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "createGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + } + ], + "name": "getMerkleTreeDepth", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + } + ], + "name": "getMerkleTreeRoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + } + ], + "name": "getMerkleTreeSize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "groups", + "outputs": [ + { + "internalType": "uint256", + "name": "merkleTreeDuration", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + } + ], + "name": "hasMember", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + } + ], + "name": "indexOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "merkleProofSiblings", + "type": "uint256[]" + } + ], + "name": "removeMember", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "updateGroupAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newMerkleTreeDuration", + "type": "uint256" + } + ], + "name": "updateGroupMerkleTreeDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newIdentityCommitment", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "merkleProofSiblings", + "type": "uint256[]" + } + ], + "name": "updateMember", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "merkleTreeDepth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nullifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "message", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "scope", + "type": "uint256" + }, + { + "internalType": "uint256[8]", + "name": "points", + "type": "uint256[8]" + } + ], + "internalType": "struct ISemaphore.SemaphoreProof", + "name": "proof", + "type": "tuple" + } + ], + "name": "validateProof", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "verifier", + "outputs": [ + { + "internalType": "contract ISemaphoreVerifier", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "groupId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "merkleTreeDepth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nullifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "message", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "scope", + "type": "uint256" + }, + { + "internalType": "uint256[8]", + "name": "points", + "type": "uint256[8]" + } + ], + "internalType": "struct ISemaphore.SemaphoreProof", + "name": "proof", + "type": "tuple" + } + ], + "name": "verifyProof", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" } + ], + "bytecode": "0x60806040523480156200001157600080fd5b50604051620034b7380380620034b78339818101604052810190620000379190620000fd565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200012f565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000b18262000084565b9050919050565b6000620000c582620000a4565b9050919050565b620000d781620000b8565b8114620000e357600080fd5b50565b600081519050620000f781620000cc565b92915050565b6000602082840312156200011657620001156200007f565b5b60006200012684828501620000e6565b91505092915050565b613378806200013f6000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80636cdd32fe116100a2578063b180517911610071578063b1805179146102da578063c96e71fb146102f6578063d0d898dd14610312578063dabc4d511461032e578063fcf0b6ec1461035e5761010b565b80636cdd32fe1461022e5780637ee35a0c1461024a57806390509d441461027a57806396324bd4146102aa5761010b565b80634178c4d5116100de5780634178c4d514610196578063456f4188146101b2578063568ee826146101e25780636389e107146101fe5761010b565b8063042453711461011057806306dd84851461012c5780631783efc31461015c5780632b7ac3f314610178575b600080fd5b61012a600480360381019061012591906126de565b61037a565b005b6101466004803603810190610141919061273e565b6103c4565b604051610153919061278d565b60405180910390f35b6101766004803603810190610171919061273e565b6103f2565b005b61018061043a565b60405161018d9190612827565b60405180910390f35b6101b060048036038101906101ab9190612842565b610460565b005b6101cc60048036038101906101c791906128ef565b6104ae565b6040516101d9919061294b565b60405180910390f35b6101fc60048036038101906101f791906129a4565b6108f3565b005b610218600480360381019061021391906129e4565b610901565b604051610225919061278d565b60405180910390f35b61024860048036038101906102439190612a11565b610920565b005b610264600480360381019061025f91906129e4565b61096c565b604051610271919061278d565b60405180910390f35b610294600480360381019061028f919061273e565b61098b565b6040516102a1919061294b565b60405180910390f35b6102c460048036038101906102bf91906129e4565b6109b9565b6040516102d1919061278d565b60405180910390f35b6102f460048036038101906102ef9190612a85565b6109d7565b005b610310600480360381019061030b91906129a4565b610a01565b005b61032c600480360381019061032791906128ef565b610a2c565b005b610348600480360381019061034391906129e4565b610c16565b604051610355919061278d565b60405180910390f35b6103786004803603810190610373919061273e565b610c39565b005b610385838383610de3565b600061039084610c16565b9050426003600086815260200190815260200160002060010160008381526020019081526020016000208190555050505050565b60006103ea82600080868152602001908152602001600020610e5f90919063ffffffff16565b905092915050565b6103fc8282610e8b565b600061040783610c16565b90504260036000858152602001908152602001600020600101600083815260200190815260200160002081905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61046d8585858585611037565b600061047886610c16565b90504260036000888152602001908152602001600020600101600083815260200190815260200160002081905550505050505050565b600082600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361054a576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001836000013510806105615750600c8360000135115b15610598576040517fecf64f1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105a38561096c565b9050600081036105df576040517fc8b02e0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105ea86610c16565b9050808560200135146106c4576000600360008881526020019081526020016000206001016000876020013581526020019081526020016000205490506000600360008981526020019081526020016000206000015490506000820361067c576040517f4d32958600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80826106889190612b07565b4211156106c1576040517f9581a99000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a23f019960405180604001604052808860a00160006008811061072457610723612b3b565b5b602002013581526020018860a00160016008811061074557610744612b3b565b5b6020020135815250604051806040016040528060405180604001604052808b60a00160026008811061077a57610779612b3b565b5b602002013581526020018b60a00160036008811061079b5761079a612b3b565b5b6020020135815250815260200160405180604001604052808b60a0016004600881106107ca576107c9612b3b565b5b602002013581526020018b60a0016005600881106107eb576107ea612b3b565b5b602002013581525081525060405180604001604052808a60a00160066008811061081857610817612b3b565b5b602002013581526020018a60a00160076008811061083957610838612b3b565b5b602002013581525060405180608001604052808b6020013581526020018b60400135815260200161086d8c60600135611209565b815260200161087f8c60800135611209565b8152508a600001356040518663ffffffff1660e01b81526004016108a7959493929190612d97565b602060405180830381865afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e89190612e19565b935050505092915050565b6108fd8282611240565b5050565b6000806000838152602001908152602001600020600101549050919050565b61092c84848484611426565b600061093785610c16565b905042600360008781526020019081526020016000206001016000838152602001908152602001600020819055505050505050565b6000806000838152602001908152602001600020600001549050919050565b60006109b1826000808681526020019081526020016000206115f390919063ffffffff16565b905092915050565b60036020528060005260406000206000915090508060000154905081565b6109e18383611616565b806003600085815260200190815260200160002060000181905550505050565b610a0b8282611616565b610e1060036000848152602001908152602001600020600001819055505050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ac6576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003600084815260200190815260200160002060020160008360400135815260200190815260200160002060009054906101000a900460ff1615610b36576040517f208b15e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b4083836104ae565b610b76576040517f4aa6bc4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016003600085815260200190815260200160002060020160008460400135815260200190815260200160002060006101000a81548160ff02191690831515021790555081608001358260200135847f0c32e14cfe81a05d371c248d22de6b7ae849e981b76a1f8842e7b6da73fc405a8560000135866040013587606001358860a001604051610c099493929190612e60565b60405180910390a4505050565b6000610c3260008084815260200190815260200160002061178e565b9050919050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610cd3576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6c576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060036000868152602001908152602001600020600001549050836003600087815260200190815260200160002060000181905550847f264b2a8f6763c084235fe832ba903482b2ef1a521336881fc75b987c2dfd29c58286604051610dd4929190612ea6565b60405180910390a25050505050565b6000610dee8461096c565b90506000610e1884846000808981526020019081526020016000206117b19092919063ffffffff16565b9050847f61e5e8054e3daf084a0c6c646c065e8bf5e7ca4d5567bda942309bd1652f349d83868685604051610e509493929190612f41565b60405180910390a25050505050565b6000600183600301600084815260200190815260200160002054610e839190612f81565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610f25576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbe576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fc98561096c565b90506000610ff185600080898152602001908152602001600020611dae90919063ffffffff16565b9050857f19239b3f93cd10558aaf11423af70c77763bf54f52bcc75bfa74d4d13548cde983878460405161102793929190612fb5565b60405180910390a2505050505050565b84600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036110d1576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116a576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611190876000808b8152602001908152602001600020610e5f90919063ffffffff16565b905060006111be888888886000808f815260200190815260200160002061202a90949392919063ffffffff16565b9050887fea3588e4a2a0c93d6a0e69dfeaf7496f43ccccf02ad9ce0a5b7627cbca4b61b1838a8a856040516111f69493929190612fec565b60405180910390a2505050505050505050565b600060088260405160200161121e9190613052565b6040516020818303038152906040528051906020012060001c901c9050919050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036112da576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611373576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16857f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a450505050565b83600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036114c0576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b843373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611559576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061157f866000808a8152602001908152602001600020610e5f90919063ffffffff16565b905060006115ab8787876000808d815260200190815260200160002061261f909392919063ffffffff16565b9050877f3108849c053c77b8073a11256dffb5ffd5b55e93e105a355e1c9061db890d8718389846040516115e193929190612fb5565b60405180910390a25050505050505050565b600080836003016000848152602001908152602001600020541415905092915050565b600073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116af576040517f8121725b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550817ff0adfb94eab6daf835deb69c5738fe636150c3dfd08094a76f39b963dc8cb05a60405160405180910390a28073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff16837f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a45050565b600081600201600083600101548152602001908152602001600020549050919050565b600080600090505b8383905081101561193c577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018484838181106117f8576117f7612b3b565b5b9050602002013510611836576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084848381811061184b5761184a612b3b565b5b9050602002013503611889576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ac858585848181106118a05761189f612b3b565b5b905060200201356115f3565b156118e3576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600186600001546118f59190612b07565b6118ff9190612b07565b85600301600086868581811061191857611917612b3b565b5b905060200201358152602001908152602001600020819055508060010190506117b9565b506060838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505090505b8383905085600001546119979190612b07565b856001015460026119a891906131a0565b10156119cf5760018560010160008282546119c39190612b07565b92505081905550611984565b60008560000154905060008585905087600001546119ed9190612b07565b90506000600183901c90506000600180600185611a0a9190612f81565b901c611a169190612b07565b905060005b8960010154811015611d2c5760008383611a359190612f81565b905060008167ffffffffffffffff811115611a5357611a526131eb565b5b604051908082528060200260200182016040528015611a815781602001602082028036833780820191505090505b50905060005b82811015611c535760008088600160028a86611aa39190612b07565b611aad919061321a565b611ab79190612b07565b1015611b09578a8a600160028b87611acf9190612b07565b611ad9919061321a565b611ae39190612b07565b611aed9190612f81565b81518110611afe57611afd612b3b565b5b602002602001015191505b8960028985611b189190612b07565b611b22919061321a565b1015611b45578e6002016000878152602001908152602001600020549050611b85565b8a8a60028a86611b559190612b07565b611b5f919061321a565b611b699190612f81565b81518110611b7a57611b79612b3b565b5b602002602001015190505b6000808314611c215773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280858152602001868152506040518263ffffffff1660e01b8152600401611bd991906132e5565b602060405180830381865af4158015611bf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1a9190613315565b9050611c25565b8190505b80858581518110611c3957611c38612b3b565b5b602002602001018181525050836001019350505050611a87565b50600180871603611ca4578760018951611c6d9190612f81565b81518110611c7e57611c7d612b3b565b5b60200260200101518c600201600085815260200190815260200160002081905550611cf1565b600188511115611cf0578760028951611cbd9190612f81565b81518110611cce57611ccd612b3b565b5b60200260200101518c6002016000858152602001908152602001600020819055505b5b849650600185901c9450809750839550600180600186611d119190612f81565b901c611d1d9190612b07565b93508260010192505050611a1b565b5087879050896000016000828254611d449190612b07565b9250508190555084600081518110611d5f57611d5e612b3b565b5b60200260200101518960020160008b6001015481526020019081526020016000208190555084600081518110611d9857611d97612b3b565b5b6020026020010151955050505050509392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018210611e09576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008203611e43576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e4d83836115f3565b15611e84576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b60018360000154611e969190612b07565b83600101546002611ea791906131a0565b1015611ece576001836001016000828254611ec29190612b07565b92505081905550611e85565b600083600001549050600083905060005b8560010154811015611fc6576001808285901c1603611fa05773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280896002016000868152602001908152602001600020548152602001858152506040518263ffffffff1660e01b8152600401611f5891906132e5565b602060405180830381865af4158015611f75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f999190613315565b9150611fbb565b81866002016000838152602001908152602001600020819055505b806001019050611edf565b506001856000016000828254611fdc9190612b07565b92505081905550808560020160008760010154815260200190815260200160002081905550846000015485600301600086815260200190815260200160002081905550809250505092915050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018410612085576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61208f86866115f3565b6120c5576040517f7204756c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084141580156120dc57506120db86856115f3565b5b15612113576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008383905003612150576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061215c8787610e5f565b905060008590506000879050600060018a6000015461217b9190612f81565b90506000805b8b60010154811015612564576001808288901c1603612365577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018989848181106121ce576121cd612b3b565b5b905060200201351061220c576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c8781811061224457612243612b3b565b5b905060200201358152602001888152506040518263ffffffff1660e01b815260040161227091906132e5565b602060405180830381865af415801561228d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b19190613315565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c878181106122eb576122ea612b3b565b5b905060200201358152602001878152506040518263ffffffff1660e01b815260040161231791906132e5565b602060405180830381865af4158015612334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123589190613315565b9350816001019150612559565b8083901c8187901c1461253d577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018989848181106123a6576123a5612b3b565b5b90506020020135106123e4576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808881526020018c8c8781811061242257612421612b3b565b5b905060200201358152506040518263ffffffff1660e01b815260040161244891906132e5565b602060405180830381865af4158015612465573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124899190613315565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808781526020018c8c878181106124c9576124c8612b3b565b5b905060200201358152506040518263ffffffff1660e01b81526004016124ef91906132e5565b602060405180830381865af415801561250c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125309190613315565b9350816001019150612558565b848c6002016000848152602001908152602001600020819055505b5b806001019050612181565b5061256e8b61178e565b83146125a6576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838b60020160008d600101548152602001908152602001600020819055508a60030160008b8152602001908152602001600020548b60030160008b81526020019081526020016000208190555060008b60030160008c815260200190815260200160002081905550839550505050505095945050505050565b600061262f85856000868661202a565b9050949350505050565b600080fd5b600080fd5b6000819050919050565b61265681612643565b811461266157600080fd5b50565b6000813590506126738161264d565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261269e5761269d612679565b5b8235905067ffffffffffffffff8111156126bb576126ba61267e565b5b6020830191508360208202830111156126d7576126d6612683565b5b9250929050565b6000806000604084860312156126f7576126f6612639565b5b600061270586828701612664565b935050602084013567ffffffffffffffff8111156127265761272561263e565b5b61273286828701612688565b92509250509250925092565b6000806040838503121561275557612754612639565b5b600061276385828601612664565b925050602061277485828601612664565b9150509250929050565b61278781612643565b82525050565b60006020820190506127a2600083018461277e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006127ed6127e86127e3846127a8565b6127c8565b6127a8565b9050919050565b60006127ff826127d2565b9050919050565b6000612811826127f4565b9050919050565b61282181612806565b82525050565b600060208201905061283c6000830184612818565b92915050565b60008060008060006080868803121561285e5761285d612639565b5b600061286c88828901612664565b955050602061287d88828901612664565b945050604061288e88828901612664565b935050606086013567ffffffffffffffff8111156128af576128ae61263e565b5b6128bb88828901612688565b92509250509295509295909350565b600080fd5b60006101a082840312156128e6576128e56128ca565b5b81905092915050565b6000806101c0838503121561290757612906612639565b5b600061291585828601612664565b9250506020612926858286016128cf565b9150509250929050565b60008115159050919050565b61294581612930565b82525050565b6000602082019050612960600083018461293c565b92915050565b6000612971826127a8565b9050919050565b61298181612966565b811461298c57600080fd5b50565b60008135905061299e81612978565b92915050565b600080604083850312156129bb576129ba612639565b5b60006129c985828601612664565b92505060206129da8582860161298f565b9150509250929050565b6000602082840312156129fa576129f9612639565b5b6000612a0884828501612664565b91505092915050565b60008060008060608587031215612a2b57612a2a612639565b5b6000612a3987828801612664565b9450506020612a4a87828801612664565b935050604085013567ffffffffffffffff811115612a6b57612a6a61263e565b5b612a7787828801612688565b925092505092959194509250565b600080600060608486031215612a9e57612a9d612639565b5b6000612aac86828701612664565b9350506020612abd8682870161298f565b9250506040612ace86828701612664565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612b1282612643565b9150612b1d83612643565b9250828201905080821115612b3557612b34612ad8565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060029050919050565b600081905092915050565b6000819050919050565b612b9381612643565b82525050565b6000612ba58383612b8a565b60208301905092915050565b6000602082019050919050565b612bc781612b6a565b612bd18184612b75565b9250612bdc82612b80565b8060005b83811015612c0d578151612bf48782612b99565b9650612bff83612bb1565b925050600181019050612be0565b505050505050565b600060029050919050565b600081905092915050565b6000819050919050565b600081905092915050565b612c4981612b6a565b612c538184612c35565b9250612c5e82612b80565b8060005b83811015612c8f578151612c768782612b99565b9650612c8183612bb1565b925050600181019050612c62565b505050505050565b6000612ca38383612c40565b60408301905092915050565b6000602082019050919050565b612cc581612c15565b612ccf8184612c20565b9250612cda82612c2b565b8060005b83811015612d0b578151612cf28782612c97565b9650612cfd83612caf565b925050600181019050612cde565b505050505050565b600060049050919050565b600081905092915050565b6000819050919050565b6000602082019050919050565b612d4981612d13565b612d538184612d1e565b9250612d5e82612d29565b8060005b83811015612d8f578151612d768782612b99565b9650612d8183612d33565b925050600181019050612d62565b505050505050565b60006101a082019050612dad6000830188612bbe565b612dba6040830187612cbc565b612dc760c0830186612bbe565b612dd5610100830185612d40565b612de361018083018461277e565b9695505050505050565b612df681612930565b8114612e0157600080fd5b50565b600081519050612e1381612ded565b92915050565b600060208284031215612e2f57612e2e612639565b5b6000612e3d84828501612e04565b91505092915050565b82818337505050565b612e5c6101008383612e46565b5050565b600061016082019050612e76600083018761277e565b612e83602083018661277e565b612e90604083018561277e565b612e9d6060830184612e4f565b95945050505050565b6000604082019050612ebb600083018561277e565b612ec8602083018461277e565b9392505050565b600082825260208201905092915050565b600080fd5b6000612ef18385612ecf565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612f2457612f23612ee0565b5b602083029250612f35838584612e46565b82840190509392505050565b6000606082019050612f56600083018761277e565b8181036020830152612f69818587612ee5565b9050612f78604083018461277e565b95945050505050565b6000612f8c82612643565b9150612f9783612643565b9250828203905081811115612faf57612fae612ad8565b5b92915050565b6000606082019050612fca600083018661277e565b612fd7602083018561277e565b612fe4604083018461277e565b949350505050565b6000608082019050613001600083018761277e565b61300e602083018661277e565b61301b604083018561277e565b613028606083018461277e565b95945050505050565b6000819050919050565b61304c61304782612643565b613031565b82525050565b600061305e828461303b565b60208201915081905092915050565b60008160011c9050919050565b6000808291508390505b60018511156130c4578086048111156130a05761309f612ad8565b5b60018516156130af5780820291505b80810290506130bd8561306d565b9450613084565b94509492505050565b6000826130dd5760019050613199565b816130eb5760009050613199565b8160018114613101576002811461310b5761313a565b6001915050613199565b60ff84111561311d5761311c612ad8565b5b8360020a91508482111561313457613133612ad8565b5b50613199565b5060208310610133831016604e8410600b841016171561316f5782820a90508381111561316a57613169612ad8565b5b613199565b61317c848484600161307a565b9250905081840481111561319357613192612ad8565b5b81810290505b9392505050565b60006131ab82612643565b91506131b683612643565b92506131e37fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846130cd565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600061322582612643565b915061323083612643565b925082820261323e81612643565b9150828204841483151761325557613254612ad8565b5b5092915050565b600081905092915050565b61327081612643565b82525050565b60006132828383613267565b60208301905092915050565b61329781612b6a565b6132a1818461325c565b92506132ac82612b80565b8060005b838110156132dd5781516132c48782613276565b96506132cf83612bb1565b9250506001810190506132b0565b505050505050565b60006040820190506132fa600083018461328e565b92915050565b60008151905061330f8161264d565b92915050565b60006020828403121561332b5761332a612639565b5b600061333984828501613300565b9150509291505056fea2646970667358221220e0b6222c33c29ae57a5eb66f9d83c18e32d11b0e99b53a5f7011850d51605d2d64736f6c63430008170033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80636cdd32fe116100a2578063b180517911610071578063b1805179146102da578063c96e71fb146102f6578063d0d898dd14610312578063dabc4d511461032e578063fcf0b6ec1461035e5761010b565b80636cdd32fe1461022e5780637ee35a0c1461024a57806390509d441461027a57806396324bd4146102aa5761010b565b80634178c4d5116100de5780634178c4d514610196578063456f4188146101b2578063568ee826146101e25780636389e107146101fe5761010b565b8063042453711461011057806306dd84851461012c5780631783efc31461015c5780632b7ac3f314610178575b600080fd5b61012a600480360381019061012591906126de565b61037a565b005b6101466004803603810190610141919061273e565b6103c4565b604051610153919061278d565b60405180910390f35b6101766004803603810190610171919061273e565b6103f2565b005b61018061043a565b60405161018d9190612827565b60405180910390f35b6101b060048036038101906101ab9190612842565b610460565b005b6101cc60048036038101906101c791906128ef565b6104ae565b6040516101d9919061294b565b60405180910390f35b6101fc60048036038101906101f791906129a4565b6108f3565b005b610218600480360381019061021391906129e4565b610901565b604051610225919061278d565b60405180910390f35b61024860048036038101906102439190612a11565b610920565b005b610264600480360381019061025f91906129e4565b61096c565b604051610271919061278d565b60405180910390f35b610294600480360381019061028f919061273e565b61098b565b6040516102a1919061294b565b60405180910390f35b6102c460048036038101906102bf91906129e4565b6109b9565b6040516102d1919061278d565b60405180910390f35b6102f460048036038101906102ef9190612a85565b6109d7565b005b610310600480360381019061030b91906129a4565b610a01565b005b61032c600480360381019061032791906128ef565b610a2c565b005b610348600480360381019061034391906129e4565b610c16565b604051610355919061278d565b60405180910390f35b6103786004803603810190610373919061273e565b610c39565b005b610385838383610de3565b600061039084610c16565b9050426003600086815260200190815260200160002060010160008381526020019081526020016000208190555050505050565b60006103ea82600080868152602001908152602001600020610e5f90919063ffffffff16565b905092915050565b6103fc8282610e8b565b600061040783610c16565b90504260036000858152602001908152602001600020600101600083815260200190815260200160002081905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61046d8585858585611037565b600061047886610c16565b90504260036000888152602001908152602001600020600101600083815260200190815260200160002081905550505050505050565b600082600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361054a576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001836000013510806105615750600c8360000135115b15610598576040517fecf64f1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105a38561096c565b9050600081036105df576040517fc8b02e0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105ea86610c16565b9050808560200135146106c4576000600360008881526020019081526020016000206001016000876020013581526020019081526020016000205490506000600360008981526020019081526020016000206000015490506000820361067c576040517f4d32958600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80826106889190612b07565b4211156106c1576040517f9581a99000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a23f019960405180604001604052808860a00160006008811061072457610723612b3b565b5b602002013581526020018860a00160016008811061074557610744612b3b565b5b6020020135815250604051806040016040528060405180604001604052808b60a00160026008811061077a57610779612b3b565b5b602002013581526020018b60a00160036008811061079b5761079a612b3b565b5b6020020135815250815260200160405180604001604052808b60a0016004600881106107ca576107c9612b3b565b5b602002013581526020018b60a0016005600881106107eb576107ea612b3b565b5b602002013581525081525060405180604001604052808a60a00160066008811061081857610817612b3b565b5b602002013581526020018a60a00160076008811061083957610838612b3b565b5b602002013581525060405180608001604052808b6020013581526020018b60400135815260200161086d8c60600135611209565b815260200161087f8c60800135611209565b8152508a600001356040518663ffffffff1660e01b81526004016108a7959493929190612d97565b602060405180830381865afa1580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e89190612e19565b935050505092915050565b6108fd8282611240565b5050565b6000806000838152602001908152602001600020600101549050919050565b61092c84848484611426565b600061093785610c16565b905042600360008781526020019081526020016000206001016000838152602001908152602001600020819055505050505050565b6000806000838152602001908152602001600020600001549050919050565b60006109b1826000808681526020019081526020016000206115f390919063ffffffff16565b905092915050565b60036020528060005260406000206000915090508060000154905081565b6109e18383611616565b806003600085815260200190815260200160002060000181905550505050565b610a0b8282611616565b610e1060036000848152602001908152602001600020600001819055505050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610ac6576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003600084815260200190815260200160002060020160008360400135815260200190815260200160002060009054906101000a900460ff1615610b36576040517f208b15e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b4083836104ae565b610b76576040517f4aa6bc4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016003600085815260200190815260200160002060020160008460400135815260200190815260200160002060006101000a81548160ff02191690831515021790555081608001358260200135847f0c32e14cfe81a05d371c248d22de6b7ae849e981b76a1f8842e7b6da73fc405a8560000135866040013587606001358860a001604051610c099493929190612e60565b60405180910390a4505050565b6000610c3260008084815260200190815260200160002061178e565b9050919050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610cd3576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6c576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060036000868152602001908152602001600020600001549050836003600087815260200190815260200160002060000181905550847f264b2a8f6763c084235fe832ba903482b2ef1a521336881fc75b987c2dfd29c58286604051610dd4929190612ea6565b60405180910390a25050505050565b6000610dee8461096c565b90506000610e1884846000808981526020019081526020016000206117b19092919063ffffffff16565b9050847f61e5e8054e3daf084a0c6c646c065e8bf5e7ca4d5567bda942309bd1652f349d83868685604051610e509493929190612f41565b60405180910390a25050505050565b6000600183600301600084815260200190815260200160002054610e839190612f81565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610f25576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbe576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610fc98561096c565b90506000610ff185600080898152602001908152602001600020611dae90919063ffffffff16565b9050857f19239b3f93cd10558aaf11423af70c77763bf54f52bcc75bfa74d4d13548cde983878460405161102793929190612fb5565b60405180910390a2505050505050565b84600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036110d1576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b853373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116a576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611190876000808b8152602001908152602001600020610e5f90919063ffffffff16565b905060006111be888888886000808f815260200190815260200160002061202a90949392919063ffffffff16565b9050887fea3588e4a2a0c93d6a0e69dfeaf7496f43ccccf02ad9ce0a5b7627cbca4b61b1838a8a856040516111f69493929190612fec565b60405180910390a2505050505050505050565b600060088260405160200161121e9190613052565b6040516020818303038152906040528051906020012060001c901c9050919050565b81600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036112da576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611373576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b826001600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16857f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a450505050565b83600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036114c0576040517f029f057900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b843373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611559576040517fbb9bf27800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061157f866000808a8152602001908152602001600020610e5f90919063ffffffff16565b905060006115ab8787876000808d815260200190815260200160002061261f909392919063ffffffff16565b9050877f3108849c053c77b8073a11256dffb5ffd5b55e93e105a355e1c9061db890d8718389846040516115e193929190612fb5565b60405180910390a25050505050505050565b600080836003016000848152602001908152602001600020541415905092915050565b600073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116af576040517f8121725b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550817ff0adfb94eab6daf835deb69c5738fe636150c3dfd08094a76f39b963dc8cb05a60405160405180910390a28073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff16837f0ba83579a0e79193ef649b9f5a8759d35af086ba62a3e207b52e4a8ae30d49e360405160405180910390a45050565b600081600201600083600101548152602001908152602001600020549050919050565b600080600090505b8383905081101561193c577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018484838181106117f8576117f7612b3b565b5b9050602002013510611836576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084848381811061184b5761184a612b3b565b5b9050602002013503611889576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ac858585848181106118a05761189f612b3b565b5b905060200201356115f3565b156118e3576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600186600001546118f59190612b07565b6118ff9190612b07565b85600301600086868581811061191857611917612b3b565b5b905060200201358152602001908152602001600020819055508060010190506117b9565b506060838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505090505b8383905085600001546119979190612b07565b856001015460026119a891906131a0565b10156119cf5760018560010160008282546119c39190612b07565b92505081905550611984565b60008560000154905060008585905087600001546119ed9190612b07565b90506000600183901c90506000600180600185611a0a9190612f81565b901c611a169190612b07565b905060005b8960010154811015611d2c5760008383611a359190612f81565b905060008167ffffffffffffffff811115611a5357611a526131eb565b5b604051908082528060200260200182016040528015611a815781602001602082028036833780820191505090505b50905060005b82811015611c535760008088600160028a86611aa39190612b07565b611aad919061321a565b611ab79190612b07565b1015611b09578a8a600160028b87611acf9190612b07565b611ad9919061321a565b611ae39190612b07565b611aed9190612f81565b81518110611afe57611afd612b3b565b5b602002602001015191505b8960028985611b189190612b07565b611b22919061321a565b1015611b45578e6002016000878152602001908152602001600020549050611b85565b8a8a60028a86611b559190612b07565b611b5f919061321a565b611b699190612f81565b81518110611b7a57611b79612b3b565b5b602002602001015190505b6000808314611c215773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280858152602001868152506040518263ffffffff1660e01b8152600401611bd991906132e5565b602060405180830381865af4158015611bf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1a9190613315565b9050611c25565b8190505b80858581518110611c3957611c38612b3b565b5b602002602001018181525050836001019350505050611a87565b50600180871603611ca4578760018951611c6d9190612f81565b81518110611c7e57611c7d612b3b565b5b60200260200101518c600201600085815260200190815260200160002081905550611cf1565b600188511115611cf0578760028951611cbd9190612f81565b81518110611cce57611ccd612b3b565b5b60200260200101518c6002016000858152602001908152602001600020819055505b5b849650600185901c9450809750839550600180600186611d119190612f81565b901c611d1d9190612b07565b93508260010192505050611a1b565b5087879050896000016000828254611d449190612b07565b9250508190555084600081518110611d5f57611d5e612b3b565b5b60200260200101518960020160008b6001015481526020019081526020016000208190555084600081518110611d9857611d97612b3b565b5b6020026020010151955050505050509392505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018210611e09576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008203611e43576040517f29691be200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e4d83836115f3565b15611e84576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b60018360000154611e969190612b07565b83600101546002611ea791906131a0565b1015611ece576001836001016000828254611ec29190612b07565b92505081905550611e85565b600083600001549050600083905060005b8560010154811015611fc6576001808285901c1603611fa05773__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe6040518060400160405280896002016000868152602001908152602001600020548152602001858152506040518263ffffffff1660e01b8152600401611f5891906132e5565b602060405180830381865af4158015611f75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f999190613315565b9150611fbb565b81866002016000838152602001908152602001600020819055505b806001019050611edf565b506001856000016000828254611fdc9190612b07565b92505081905550808560020160008760010154815260200190815260200160002081905550846000015485600301600086815260200190815260200160002081905550809250505092915050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018410612085576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61208f86866115f3565b6120c5576040517f7204756c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084141580156120dc57506120db86856115f3565b5b15612113576040517f258a195a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008383905003612150576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061215c8787610e5f565b905060008590506000879050600060018a6000015461217b9190612f81565b90506000805b8b60010154811015612564576001808288901c1603612365577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018989848181106121ce576121cd612b3b565b5b905060200201351061220c576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c8781811061224457612243612b3b565b5b905060200201358152602001888152506040518263ffffffff1660e01b815260040161227091906132e5565b602060405180830381865af415801561228d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b19190613315565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808c8c878181106122eb576122ea612b3b565b5b905060200201358152602001878152506040518263ffffffff1660e01b815260040161231791906132e5565b602060405180830381865af4158015612334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123589190613315565b9350816001019150612559565b8083901c8187901c1461253d577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018989848181106123a6576123a5612b3b565b5b90506020020135106123e4576040517fc380a82e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808881526020018c8c8781811061242257612421612b3b565b5b905060200201358152506040518263ffffffff1660e01b815260040161244891906132e5565b602060405180830381865af4158015612465573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124899190613315565b945073__$75f79a42d9bcbdbb69ad79ebd80f556f39$__63561558fe60405180604001604052808781526020018c8c878181106124c9576124c8612b3b565b5b905060200201358152506040518263ffffffff1660e01b81526004016124ef91906132e5565b602060405180830381865af415801561250c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125309190613315565b9350816001019150612558565b848c6002016000848152602001908152602001600020819055505b5b806001019050612181565b5061256e8b61178e565b83146125a6576040517f3fa930c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838b60020160008d600101548152602001908152602001600020819055508a60030160008b8152602001908152602001600020548b60030160008b81526020019081526020016000208190555060008b60030160008c815260200190815260200160002081905550839550505050505095945050505050565b600061262f85856000868661202a565b9050949350505050565b600080fd5b600080fd5b6000819050919050565b61265681612643565b811461266157600080fd5b50565b6000813590506126738161264d565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261269e5761269d612679565b5b8235905067ffffffffffffffff8111156126bb576126ba61267e565b5b6020830191508360208202830111156126d7576126d6612683565b5b9250929050565b6000806000604084860312156126f7576126f6612639565b5b600061270586828701612664565b935050602084013567ffffffffffffffff8111156127265761272561263e565b5b61273286828701612688565b92509250509250925092565b6000806040838503121561275557612754612639565b5b600061276385828601612664565b925050602061277485828601612664565b9150509250929050565b61278781612643565b82525050565b60006020820190506127a2600083018461277e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006127ed6127e86127e3846127a8565b6127c8565b6127a8565b9050919050565b60006127ff826127d2565b9050919050565b6000612811826127f4565b9050919050565b61282181612806565b82525050565b600060208201905061283c6000830184612818565b92915050565b60008060008060006080868803121561285e5761285d612639565b5b600061286c88828901612664565b955050602061287d88828901612664565b945050604061288e88828901612664565b935050606086013567ffffffffffffffff8111156128af576128ae61263e565b5b6128bb88828901612688565b92509250509295509295909350565b600080fd5b60006101a082840312156128e6576128e56128ca565b5b81905092915050565b6000806101c0838503121561290757612906612639565b5b600061291585828601612664565b9250506020612926858286016128cf565b9150509250929050565b60008115159050919050565b61294581612930565b82525050565b6000602082019050612960600083018461293c565b92915050565b6000612971826127a8565b9050919050565b61298181612966565b811461298c57600080fd5b50565b60008135905061299e81612978565b92915050565b600080604083850312156129bb576129ba612639565b5b60006129c985828601612664565b92505060206129da8582860161298f565b9150509250929050565b6000602082840312156129fa576129f9612639565b5b6000612a0884828501612664565b91505092915050565b60008060008060608587031215612a2b57612a2a612639565b5b6000612a3987828801612664565b9450506020612a4a87828801612664565b935050604085013567ffffffffffffffff811115612a6b57612a6a61263e565b5b612a7787828801612688565b925092505092959194509250565b600080600060608486031215612a9e57612a9d612639565b5b6000612aac86828701612664565b9350506020612abd8682870161298f565b9250506040612ace86828701612664565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612b1282612643565b9150612b1d83612643565b9250828201905080821115612b3557612b34612ad8565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060029050919050565b600081905092915050565b6000819050919050565b612b9381612643565b82525050565b6000612ba58383612b8a565b60208301905092915050565b6000602082019050919050565b612bc781612b6a565b612bd18184612b75565b9250612bdc82612b80565b8060005b83811015612c0d578151612bf48782612b99565b9650612bff83612bb1565b925050600181019050612be0565b505050505050565b600060029050919050565b600081905092915050565b6000819050919050565b600081905092915050565b612c4981612b6a565b612c538184612c35565b9250612c5e82612b80565b8060005b83811015612c8f578151612c768782612b99565b9650612c8183612bb1565b925050600181019050612c62565b505050505050565b6000612ca38383612c40565b60408301905092915050565b6000602082019050919050565b612cc581612c15565b612ccf8184612c20565b9250612cda82612c2b565b8060005b83811015612d0b578151612cf28782612c97565b9650612cfd83612caf565b925050600181019050612cde565b505050505050565b600060049050919050565b600081905092915050565b6000819050919050565b6000602082019050919050565b612d4981612d13565b612d538184612d1e565b9250612d5e82612d29565b8060005b83811015612d8f578151612d768782612b99565b9650612d8183612d33565b925050600181019050612d62565b505050505050565b60006101a082019050612dad6000830188612bbe565b612dba6040830187612cbc565b612dc760c0830186612bbe565b612dd5610100830185612d40565b612de361018083018461277e565b9695505050505050565b612df681612930565b8114612e0157600080fd5b50565b600081519050612e1381612ded565b92915050565b600060208284031215612e2f57612e2e612639565b5b6000612e3d84828501612e04565b91505092915050565b82818337505050565b612e5c6101008383612e46565b5050565b600061016082019050612e76600083018761277e565b612e83602083018661277e565b612e90604083018561277e565b612e9d6060830184612e4f565b95945050505050565b6000604082019050612ebb600083018561277e565b612ec8602083018461277e565b9392505050565b600082825260208201905092915050565b600080fd5b6000612ef18385612ecf565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612f2457612f23612ee0565b5b602083029250612f35838584612e46565b82840190509392505050565b6000606082019050612f56600083018761277e565b8181036020830152612f69818587612ee5565b9050612f78604083018461277e565b95945050505050565b6000612f8c82612643565b9150612f9783612643565b9250828203905081811115612faf57612fae612ad8565b5b92915050565b6000606082019050612fca600083018661277e565b612fd7602083018561277e565b612fe4604083018461277e565b949350505050565b6000608082019050613001600083018761277e565b61300e602083018661277e565b61301b604083018561277e565b613028606083018461277e565b95945050505050565b6000819050919050565b61304c61304782612643565b613031565b82525050565b600061305e828461303b565b60208201915081905092915050565b60008160011c9050919050565b6000808291508390505b60018511156130c4578086048111156130a05761309f612ad8565b5b60018516156130af5780820291505b80810290506130bd8561306d565b9450613084565b94509492505050565b6000826130dd5760019050613199565b816130eb5760009050613199565b8160018114613101576002811461310b5761313a565b6001915050613199565b60ff84111561311d5761311c612ad8565b5b8360020a91508482111561313457613133612ad8565b5b50613199565b5060208310610133831016604e8410600b841016171561316f5782820a90508381111561316a57613169612ad8565b5b613199565b61317c848484600161307a565b9250905081840481111561319357613192612ad8565b5b81810290505b9392505050565b60006131ab82612643565b91506131b683612643565b92506131e37fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846130cd565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600061322582612643565b915061323083612643565b925082820261323e81612643565b9150828204841483151761325557613254612ad8565b5b5092915050565b600081905092915050565b61327081612643565b82525050565b60006132828383613267565b60208301905092915050565b61329781612b6a565b6132a1818461325c565b92506132ac82612b80565b8060005b838110156132dd5781516132c48782613276565b96506132cf83612bb1565b9250506001810190506132b0565b505050505050565b60006040820190506132fa600083018461328e565b92915050565b60008151905061330f8161264d565b92915050565b60006020828403121561332b5761332a612639565b5b600061333984828501613300565b9150509291505056fea2646970667358221220e0b6222c33c29ae57a5eb66f9d83c18e32d11b0e99b53a5f7011850d51605d2d64736f6c63430008170033", + "linkReferences": { + "poseidon-solidity/PoseidonT3.sol": { + "PoseidonT3": [ + { + "length": 20, + "start": 7375 + }, + { + "length": 20, + "start": 8249 + }, + { + "length": 20, + "start": 9037 + }, + { + "length": 20, + "start": 9204 + }, + { + "length": 20, + "start": 9509 + }, + { + "length": 20, + "start": 9676 + } + ] + } + }, + "deployedLinkReferences": { + "poseidon-solidity/PoseidonT3.sol": { + "PoseidonT3": [ + { + "length": 20, + "start": 7056 + }, + { + "length": 20, + "start": 7930 + }, + { + "length": 20, + "start": 8718 + }, + { + "length": 20, + "start": 8885 + }, + { + "length": 20, + "start": 9190 + }, + { + "length": 20, + "start": 9357 + } + ] + } + } } diff --git a/apps/subgraph/networks.json b/apps/subgraph/networks.json index f7e1455f..06a4011f 100644 --- a/apps/subgraph/networks.json +++ b/apps/subgraph/networks.json @@ -1,8 +1,8 @@ { "sepolia": { "Semaphore": { - "address": "0x021dC8BF0eADd9C128490A976756C1b052edF99d", - "startBlock": 5108003 + "address": "0xb25E63B115Ffba085FeCbf196a8e720F85DC351c", + "startBlock": 5145333 } }, "mumbai": { diff --git a/apps/subgraph/schema.graphql b/apps/subgraph/schema.graphql index 81966247..67a3e8a6 100644 --- a/apps/subgraph/schema.graphql +++ b/apps/subgraph/schema.graphql @@ -31,6 +31,6 @@ type ValidatedProof @entity { merkleTreeRoot: BigInt! merkleTreeDepth: Int! nullifier: BigInt! - proof: [BigInt!]! + points: [BigInt!]! group: Group! } diff --git a/apps/subgraph/src/semaphore.ts b/apps/subgraph/src/semaphore.ts index eab53de2..97880fa6 100644 --- a/apps/subgraph/src/semaphore.ts +++ b/apps/subgraph/src/semaphore.ts @@ -220,7 +220,7 @@ export function addValidatedProof(event: ProofValidated): void { validatedProof.merkleTreeDepth = event.params.merkleTreeDepth.toI32() validatedProof.scope = event.params.scope validatedProof.nullifier = event.params.nullifier - validatedProof.proof = event.params.proof + validatedProof.points = event.params.points validatedProof.timestamp = event.block.timestamp validatedProof.save() diff --git a/apps/subgraph/tests/semaphore-utils.ts b/apps/subgraph/tests/semaphore-utils.ts index 17b5777f..32229771 100644 --- a/apps/subgraph/tests/semaphore-utils.ts +++ b/apps/subgraph/tests/semaphore-utils.ts @@ -158,7 +158,7 @@ export function createProofVerifiedEvent( nullifier: BigInt, message: BigInt, scope: BigInt, - proof: BigInt[] + points: BigInt[] ): ProofValidated { const proofValidatedEvent = changetype(newMockEvent()) @@ -176,7 +176,9 @@ export function createProofVerifiedEvent( ) proofValidatedEvent.parameters.push(new ethereum.EventParam("message", ethereum.Value.fromUnsignedBigInt(message))) proofValidatedEvent.parameters.push(new ethereum.EventParam("scope", ethereum.Value.fromUnsignedBigInt(scope))) - proofValidatedEvent.parameters.push(new ethereum.EventParam("proof", ethereum.Value.fromUnsignedBigIntArray(proof))) + proofValidatedEvent.parameters.push( + new ethereum.EventParam("points", ethereum.Value.fromUnsignedBigIntArray(points)) + ) return proofValidatedEvent } diff --git a/apps/subgraph/tests/semaphore.test.ts b/apps/subgraph/tests/semaphore.test.ts index f83f10f7..f883453c 100644 --- a/apps/subgraph/tests/semaphore.test.ts +++ b/apps/subgraph/tests/semaphore.test.ts @@ -162,7 +162,7 @@ describe("Semaphore subgraph", () => { const nullifier = BigInt.fromI32(666) const message = BigInt.fromI32(2) const scope = BigInt.fromI32(1) - const proof = [BigInt.fromI32(1), BigInt.fromI32(2)] + const points = [BigInt.fromI32(1), BigInt.fromI32(2)] const id = hash(concat(ByteArray.fromBigInt(nullifier), ByteArray.fromBigInt(groupId))) const event = createProofVerifiedEvent( @@ -172,7 +172,7 @@ describe("Semaphore subgraph", () => { nullifier, message, scope, - proof + points ) addValidatedProof(event) @@ -185,7 +185,7 @@ describe("Semaphore subgraph", () => { assert.fieldEquals("ValidatedProof", id, "scope", "1") assert.fieldEquals("ValidatedProof", id, "nullifier", "666") assert.fieldEquals("ValidatedProof", id, "message", "2") - assert.fieldEquals("ValidatedProof", id, "proof", `[${proof.join(", ")}]`) + assert.fieldEquals("ValidatedProof", id, "points", `[${points.join(", ")}]`) }) }) }) diff --git a/packages/cli-template-contracts-hardhat/contracts/Feedback.sol b/packages/cli-template-contracts-hardhat/contracts/Feedback.sol index 7b2cda0f..86f9a336 100644 --- a/packages/cli-template-contracts-hardhat/contracts/Feedback.sol +++ b/packages/cli-template-contracts-hardhat/contracts/Feedback.sol @@ -24,8 +24,17 @@ contract Feedback { uint256 merkleTreeRoot, uint256 nullifier, uint256 feedback, - uint256[8] calldata proof + uint256[8] calldata points ) external { - semaphore.validateProof(groupId, merkleTreeDepth, merkleTreeRoot, nullifier, feedback, groupId, proof); + ISemaphore.SemaphoreProof memory proof = ISemaphore.SemaphoreProof( + merkleTreeDepth, + merkleTreeRoot, + nullifier, + feedback, + groupId, + points + ); + + semaphore.validateProof(groupId, proof); } } diff --git a/packages/cli-template-contracts-hardhat/test/Feedback.ts b/packages/cli-template-contracts-hardhat/test/Feedback.ts index cd36975a..7cda6214 100644 --- a/packages/cli-template-contracts-hardhat/test/Feedback.ts +++ b/packages/cli-template-contracts-hardhat/test/Feedback.ts @@ -52,7 +52,7 @@ describe("Feedback", () => { fullProof.merkleTreeRoot, fullProof.nullifier, feedback, - fullProof.proof + fullProof.points ) await expect(transaction) @@ -64,7 +64,7 @@ describe("Feedback", () => { fullProof.nullifier, fullProof.message, groupId, - fullProof.proof + fullProof.points ) }) }) diff --git a/packages/cli-template-monorepo-ethers/apps/contracts/contracts/Feedback.sol b/packages/cli-template-monorepo-ethers/apps/contracts/contracts/Feedback.sol index 7b2cda0f..86f9a336 100644 --- a/packages/cli-template-monorepo-ethers/apps/contracts/contracts/Feedback.sol +++ b/packages/cli-template-monorepo-ethers/apps/contracts/contracts/Feedback.sol @@ -24,8 +24,17 @@ contract Feedback { uint256 merkleTreeRoot, uint256 nullifier, uint256 feedback, - uint256[8] calldata proof + uint256[8] calldata points ) external { - semaphore.validateProof(groupId, merkleTreeDepth, merkleTreeRoot, nullifier, feedback, groupId, proof); + ISemaphore.SemaphoreProof memory proof = ISemaphore.SemaphoreProof( + merkleTreeDepth, + merkleTreeRoot, + nullifier, + feedback, + groupId, + points + ); + + semaphore.validateProof(groupId, proof); } } diff --git a/packages/cli-template-monorepo-ethers/apps/contracts/test/Feedback.ts b/packages/cli-template-monorepo-ethers/apps/contracts/test/Feedback.ts index cd36975a..7cda6214 100644 --- a/packages/cli-template-monorepo-ethers/apps/contracts/test/Feedback.ts +++ b/packages/cli-template-monorepo-ethers/apps/contracts/test/Feedback.ts @@ -52,7 +52,7 @@ describe("Feedback", () => { fullProof.merkleTreeRoot, fullProof.nullifier, feedback, - fullProof.proof + fullProof.points ) await expect(transaction) @@ -64,7 +64,7 @@ describe("Feedback", () => { fullProof.nullifier, fullProof.message, groupId, - fullProof.proof + fullProof.points ) }) }) diff --git a/packages/cli-template-monorepo-ethers/apps/web-app/contract-artifacts/Feedback.json b/packages/cli-template-monorepo-ethers/apps/web-app/contract-artifacts/Feedback.json index e8590cb9..5804967b 100644 --- a/packages/cli-template-monorepo-ethers/apps/web-app/contract-artifacts/Feedback.json +++ b/packages/cli-template-monorepo-ethers/apps/web-app/contract-artifacts/Feedback.json @@ -1,99 +1,99 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Feedback", - "sourceName": "contracts/Feedback.sol", - "abi": [ + "_format": "hh-sol-artifact-1", + "contractName": "Feedback", + "sourceName": "contracts/Feedback.sol", + "abi": [ + { + "inputs": [ { - "inputs": [ - { - "internalType": "contract ISemaphore", - "name": "_semaphore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_groupId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" + "internalType": "contract ISemaphore", + "name": "_semaphore", + "type": "address" }, { - "inputs": [], - "name": "groupId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - } - ], - "name": "joinGroup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "semaphore", - "outputs": [ - { - "internalType": "contract ISemaphore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "merkleTreeDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feedback", - "type": "uint256" - }, - { - "internalType": "uint256[8]", - "name": "proof", - "type": "uint256[8]" - } - ], - "name": "sendFeedback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "internalType": "uint256", + "name": "_groupId", + "type": "uint256" } - ], - "bytecode": "0x608060405234801561001057600080fd5b5060405161072b38038061072b833981810160405281019061003291906101ba565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c96e71fb600154306040518363ffffffff1660e01b81526004016100d6929190610218565b600060405180830381600087803b1580156100f057600080fd5b505af1158015610104573d6000803e3d6000fd5b505050505050610241565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061013f82610114565b9050919050565b600061015182610134565b9050919050565b61016181610146565b811461016c57600080fd5b50565b60008151905061017e81610158565b92915050565b6000819050919050565b61019781610184565b81146101a257600080fd5b50565b6000815190506101b48161018e565b92915050565b600080604083850312156101d1576101d061010f565b5b60006101df8582860161016f565b92505060206101f0858286016101a5565b9150509250929050565b61020381610184565b82525050565b61021281610134565b82525050565b600060408201905061022d60008301856101fa565b61023a6020830184610209565b9392505050565b6104db806102506000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b60405161006691906102a2565b60405180910390f35b6100896004803603810190610084919061031f565b6100e9565b005b61009361018b565b6040516100a091906103aa565b60405180910390f35b6100c360048036038101906100be91906103c5565b610191565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632694b47660015487878787600154886040518863ffffffff1660e01b8152600401610152979695949392919061040c565b600060405180830381600087803b15801561016c57600080fd5b505af1158015610180573d6000803e3d6000fd5b505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101ee92919061047c565b600060405180830381600087803b15801561020857600080fd5b505af115801561021c573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061026861026361025e84610223565b610243565b610223565b9050919050565b600061027a8261024d565b9050919050565b600061028c8261026f565b9050919050565b61029c81610281565b82525050565b60006020820190506102b76000830184610293565b92915050565b600080fd5b6000819050919050565b6102d5816102c2565b81146102e057600080fd5b50565b6000813590506102f2816102cc565b92915050565b600080fd5b600081905082602060080282011115610319576103186102f8565b5b92915050565b6000806000806000610180868803121561033c5761033b6102bd565b5b600061034a888289016102e3565b955050602061035b888289016102e3565b945050604061036c888289016102e3565b935050606061037d888289016102e3565b925050608061038e888289016102fd565b9150509295509295909350565b6103a4816102c2565b82525050565b60006020820190506103bf600083018461039b565b92915050565b6000602082840312156103db576103da6102bd565b5b60006103e9848285016102e3565b91505092915050565b82818337505050565b61040861010083836103f2565b5050565b60006101c082019050610422600083018a61039b565b61042f602083018961039b565b61043c604083018861039b565b610449606083018761039b565b610456608083018661039b565b61046360a083018561039b565b61047060c08301846103fb565b98975050505050505050565b6000604082019050610491600083018561039b565b61049e602083018461039b565b939250505056fea26469706673582212204e55122b6afd94ae34af34764263b41bcb463e4fc817ea7ab795705071f8e56f64736f6c63430008170033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b60405161006691906102a2565b60405180910390f35b6100896004803603810190610084919061031f565b6100e9565b005b61009361018b565b6040516100a091906103aa565b60405180910390f35b6100c360048036038101906100be91906103c5565b610191565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632694b47660015487878787600154886040518863ffffffff1660e01b8152600401610152979695949392919061040c565b600060405180830381600087803b15801561016c57600080fd5b505af1158015610180573d6000803e3d6000fd5b505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101ee92919061047c565b600060405180830381600087803b15801561020857600080fd5b505af115801561021c573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061026861026361025e84610223565b610243565b610223565b9050919050565b600061027a8261024d565b9050919050565b600061028c8261026f565b9050919050565b61029c81610281565b82525050565b60006020820190506102b76000830184610293565b92915050565b600080fd5b6000819050919050565b6102d5816102c2565b81146102e057600080fd5b50565b6000813590506102f2816102cc565b92915050565b600080fd5b600081905082602060080282011115610319576103186102f8565b5b92915050565b6000806000806000610180868803121561033c5761033b6102bd565b5b600061034a888289016102e3565b955050602061035b888289016102e3565b945050604061036c888289016102e3565b935050606061037d888289016102e3565b925050608061038e888289016102fd565b9150509295509295909350565b6103a4816102c2565b82525050565b60006020820190506103bf600083018461039b565b92915050565b6000602082840312156103db576103da6102bd565b5b60006103e9848285016102e3565b91505092915050565b82818337505050565b61040861010083836103f2565b5050565b60006101c082019050610422600083018a61039b565b61042f602083018961039b565b61043c604083018861039b565b610449606083018761039b565b610456608083018661039b565b61046360a083018561039b565b61047060c08301846103fb565b98975050505050505050565b6000604082019050610491600083018561039b565b61049e602083018461039b565b939250505056fea26469706673582212204e55122b6afd94ae34af34764263b41bcb463e4fc817ea7ab795705071f8e56f64736f6c63430008170033", - "linkReferences": {}, - "deployedLinkReferences": {} + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "groupId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + } + ], + "name": "joinGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "semaphore", + "outputs": [ + { + "internalType": "contract ISemaphore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "merkleTreeDepth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nullifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feedback", + "type": "uint256" + }, + { + "internalType": "uint256[8]", + "name": "points", + "type": "uint256[8]" + } + ], + "name": "sendFeedback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610851380380610851833981810160405281019061003291906101ba565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c96e71fb600154306040518363ffffffff1660e01b81526004016100d6929190610218565b600060405180830381600087803b1580156100f057600080fd5b505af1158015610104573d6000803e3d6000fd5b505050505050610241565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061013f82610114565b9050919050565b600061015182610134565b9050919050565b61016181610146565b811461016c57600080fd5b50565b60008151905061017e81610158565b92915050565b6000819050919050565b61019781610184565b81146101a257600080fd5b50565b6000815190506101b48161018e565b92915050565b600080604083850312156101d1576101d061010f565b5b60006101df8582860161016f565b92505060206101f0858286016101a5565b9150509250929050565b61020381610184565b82525050565b61021281610134565b82525050565b600060408201905061022d60008301856101fa565b61023a6020830184610209565b9392505050565b610601806102506000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b6040516100669190610301565b60405180910390f35b6100896004803603810190610084919061037e565b6100e9565b005b6100936101ea565b6040516100a09190610409565b60405180910390f35b6100c360048036038101906100be9190610424565b6101f0565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040518060c001604052808781526020018681526020018581526020018481526020016001548152602001836008806020026040519081016040528092919082600860200280828437600081840152601f19601f820116905080830192505050505050815250905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0d898dd600154836040518363ffffffff1660e01b81526004016101b0929190610578565b600060405180830381600087803b1580156101ca57600080fd5b505af11580156101de573d6000803e3d6000fd5b50505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b815260040161024d9291906105a2565b600060405180830381600087803b15801561026757600080fd5b505af115801561027b573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006102c76102c26102bd84610282565b6102a2565b610282565b9050919050565b60006102d9826102ac565b9050919050565b60006102eb826102ce565b9050919050565b6102fb816102e0565b82525050565b600060208201905061031660008301846102f2565b92915050565b600080fd5b6000819050919050565b61033481610321565b811461033f57600080fd5b50565b6000813590506103518161032b565b92915050565b600080fd5b60008190508260206008028201111561037857610377610357565b5b92915050565b6000806000806000610180868803121561039b5761039a61031c565b5b60006103a988828901610342565b95505060206103ba88828901610342565b94505060406103cb88828901610342565b93505060606103dc88828901610342565b92505060806103ed8882890161035c565b9150509295509295909350565b61040381610321565b82525050565b600060208201905061041e60008301846103fa565b92915050565b60006020828403121561043a5761043961031c565b5b600061044884828501610342565b91505092915050565b61045a81610321565b82525050565b600060089050919050565b600081905092915050565b6000819050919050565b600061048c8383610451565b60208301905092915050565b6000602082019050919050565b6104ae81610460565b6104b8818461046b565b92506104c382610476565b8060005b838110156104f45781516104db8782610480565b96506104e683610498565b9250506001810190506104c7565b505050505050565b6101a0820160008201516105136000850182610451565b5060208201516105266020850182610451565b5060408201516105396040850182610451565b50606082015161054c6060850182610451565b50608082015161055f6080850182610451565b5060a082015161057260a08501826104a5565b50505050565b60006101c08201905061058e60008301856103fa565b61059b60208301846104fc565b9392505050565b60006040820190506105b760008301856103fa565b6105c460208301846103fa565b939250505056fea26469706673582212208d1f71499c8710ebb4fc00256397c0764cbf05c24c0a365e44aa27667881cde864736f6c63430008170033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b6040516100669190610301565b60405180910390f35b6100896004803603810190610084919061037e565b6100e9565b005b6100936101ea565b6040516100a09190610409565b60405180910390f35b6100c360048036038101906100be9190610424565b6101f0565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040518060c001604052808781526020018681526020018581526020018481526020016001548152602001836008806020026040519081016040528092919082600860200280828437600081840152601f19601f820116905080830192505050505050815250905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0d898dd600154836040518363ffffffff1660e01b81526004016101b0929190610578565b600060405180830381600087803b1580156101ca57600080fd5b505af11580156101de573d6000803e3d6000fd5b50505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b815260040161024d9291906105a2565b600060405180830381600087803b15801561026757600080fd5b505af115801561027b573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006102c76102c26102bd84610282565b6102a2565b610282565b9050919050565b60006102d9826102ac565b9050919050565b60006102eb826102ce565b9050919050565b6102fb816102e0565b82525050565b600060208201905061031660008301846102f2565b92915050565b600080fd5b6000819050919050565b61033481610321565b811461033f57600080fd5b50565b6000813590506103518161032b565b92915050565b600080fd5b60008190508260206008028201111561037857610377610357565b5b92915050565b6000806000806000610180868803121561039b5761039a61031c565b5b60006103a988828901610342565b95505060206103ba88828901610342565b94505060406103cb88828901610342565b93505060606103dc88828901610342565b92505060806103ed8882890161035c565b9150509295509295909350565b61040381610321565b82525050565b600060208201905061041e60008301846103fa565b92915050565b60006020828403121561043a5761043961031c565b5b600061044884828501610342565b91505092915050565b61045a81610321565b82525050565b600060089050919050565b600081905092915050565b6000819050919050565b600061048c8383610451565b60208301905092915050565b6000602082019050919050565b6104ae81610460565b6104b8818461046b565b92506104c382610476565b8060005b838110156104f45781516104db8782610480565b96506104e683610498565b9250506001810190506104c7565b505050505050565b6101a0820160008201516105136000850182610451565b5060208201516105266020850182610451565b5060408201516105396040850182610451565b50606082015161054c6060850182610451565b50608082015161055f6080850182610451565b5060a082015161057260a08501826104a5565b50505050565b60006101c08201905061058e60008301856103fa565b61059b60208301846104fc565b9392505050565b60006040820190506105b760008301856103fa565b6105c460208301846103fa565b939250505056fea26469706673582212208d1f71499c8710ebb4fc00256397c0764cbf05c24c0a365e44aa27667881cde864736f6c63430008170033", + "linkReferences": {}, + "deployedLinkReferences": {} } diff --git a/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/api/feedback.ts b/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/api/feedback.ts index 292a7e46..12361f33 100644 --- a/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/api/feedback.ts +++ b/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/api/feedback.ts @@ -30,10 +30,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const signer = new Wallet(ethereumPrivateKey, provider) const contract = new Contract(contractAddress, Feedback.abi, signer) - const { feedback, merkleTreeDepth, merkleTreeRoot, nullifier, proof } = req.body + const { feedback, merkleTreeDepth, merkleTreeRoot, nullifier, points } = req.body try { - const transaction = await contract.sendFeedback(merkleTreeDepth, merkleTreeRoot, nullifier, feedback, proof) + const transaction = await contract.sendFeedback(merkleTreeDepth, merkleTreeRoot, nullifier, feedback, points) await transaction.wait() diff --git a/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/proofs.tsx b/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/proofs.tsx index 4e04181e..79197c89 100644 --- a/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/proofs.tsx +++ b/packages/cli-template-monorepo-ethers/apps/web-app/src/pages/proofs.tsx @@ -55,7 +55,7 @@ export default function ProofsPage() { group.addMembers(_users) - const { proof, merkleTreeDepth, merkleTreeRoot, nullifier } = await generateProof( + const { points, merkleTreeDepth, merkleTreeRoot, nullifier } = await generateProof( _identity, group, message, @@ -72,7 +72,7 @@ export default function ProofsPage() { abi: Feedback.abi, address: env.FEEDBACK_CONTRACT_ADDRESS, functionName: "sendFeedback", - functionParameters: [merkleTreeDepth, merkleTreeRoot, nullifier, message, proof] + functionParameters: [merkleTreeDepth, merkleTreeRoot, nullifier, message, points] }) }) } else { @@ -84,7 +84,7 @@ export default function ProofsPage() { merkleTreeDepth, merkleTreeRoot, nullifier, - proof + points }) }) } diff --git a/packages/cli-template-monorepo-subgraph/apps/contracts/contracts/Feedback.sol b/packages/cli-template-monorepo-subgraph/apps/contracts/contracts/Feedback.sol index 7b2cda0f..86f9a336 100644 --- a/packages/cli-template-monorepo-subgraph/apps/contracts/contracts/Feedback.sol +++ b/packages/cli-template-monorepo-subgraph/apps/contracts/contracts/Feedback.sol @@ -24,8 +24,17 @@ contract Feedback { uint256 merkleTreeRoot, uint256 nullifier, uint256 feedback, - uint256[8] calldata proof + uint256[8] calldata points ) external { - semaphore.validateProof(groupId, merkleTreeDepth, merkleTreeRoot, nullifier, feedback, groupId, proof); + ISemaphore.SemaphoreProof memory proof = ISemaphore.SemaphoreProof( + merkleTreeDepth, + merkleTreeRoot, + nullifier, + feedback, + groupId, + points + ); + + semaphore.validateProof(groupId, proof); } } diff --git a/packages/cli-template-monorepo-subgraph/apps/contracts/test/Feedback.ts b/packages/cli-template-monorepo-subgraph/apps/contracts/test/Feedback.ts index cd36975a..7cda6214 100644 --- a/packages/cli-template-monorepo-subgraph/apps/contracts/test/Feedback.ts +++ b/packages/cli-template-monorepo-subgraph/apps/contracts/test/Feedback.ts @@ -52,7 +52,7 @@ describe("Feedback", () => { fullProof.merkleTreeRoot, fullProof.nullifier, feedback, - fullProof.proof + fullProof.points ) await expect(transaction) @@ -64,7 +64,7 @@ describe("Feedback", () => { fullProof.nullifier, fullProof.message, groupId, - fullProof.proof + fullProof.points ) }) }) diff --git a/packages/cli-template-monorepo-subgraph/apps/web-app/contract-artifacts/Feedback.json b/packages/cli-template-monorepo-subgraph/apps/web-app/contract-artifacts/Feedback.json index e8590cb9..5804967b 100644 --- a/packages/cli-template-monorepo-subgraph/apps/web-app/contract-artifacts/Feedback.json +++ b/packages/cli-template-monorepo-subgraph/apps/web-app/contract-artifacts/Feedback.json @@ -1,99 +1,99 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Feedback", - "sourceName": "contracts/Feedback.sol", - "abi": [ + "_format": "hh-sol-artifact-1", + "contractName": "Feedback", + "sourceName": "contracts/Feedback.sol", + "abi": [ + { + "inputs": [ { - "inputs": [ - { - "internalType": "contract ISemaphore", - "name": "_semaphore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_groupId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" + "internalType": "contract ISemaphore", + "name": "_semaphore", + "type": "address" }, { - "inputs": [], - "name": "groupId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "identityCommitment", - "type": "uint256" - } - ], - "name": "joinGroup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "semaphore", - "outputs": [ - { - "internalType": "contract ISemaphore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "merkleTreeDepth", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "merkleTreeRoot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feedback", - "type": "uint256" - }, - { - "internalType": "uint256[8]", - "name": "proof", - "type": "uint256[8]" - } - ], - "name": "sendFeedback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "internalType": "uint256", + "name": "_groupId", + "type": "uint256" } - ], - "bytecode": "0x608060405234801561001057600080fd5b5060405161072b38038061072b833981810160405281019061003291906101ba565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c96e71fb600154306040518363ffffffff1660e01b81526004016100d6929190610218565b600060405180830381600087803b1580156100f057600080fd5b505af1158015610104573d6000803e3d6000fd5b505050505050610241565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061013f82610114565b9050919050565b600061015182610134565b9050919050565b61016181610146565b811461016c57600080fd5b50565b60008151905061017e81610158565b92915050565b6000819050919050565b61019781610184565b81146101a257600080fd5b50565b6000815190506101b48161018e565b92915050565b600080604083850312156101d1576101d061010f565b5b60006101df8582860161016f565b92505060206101f0858286016101a5565b9150509250929050565b61020381610184565b82525050565b61021281610134565b82525050565b600060408201905061022d60008301856101fa565b61023a6020830184610209565b9392505050565b6104db806102506000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b60405161006691906102a2565b60405180910390f35b6100896004803603810190610084919061031f565b6100e9565b005b61009361018b565b6040516100a091906103aa565b60405180910390f35b6100c360048036038101906100be91906103c5565b610191565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632694b47660015487878787600154886040518863ffffffff1660e01b8152600401610152979695949392919061040c565b600060405180830381600087803b15801561016c57600080fd5b505af1158015610180573d6000803e3d6000fd5b505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101ee92919061047c565b600060405180830381600087803b15801561020857600080fd5b505af115801561021c573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061026861026361025e84610223565b610243565b610223565b9050919050565b600061027a8261024d565b9050919050565b600061028c8261026f565b9050919050565b61029c81610281565b82525050565b60006020820190506102b76000830184610293565b92915050565b600080fd5b6000819050919050565b6102d5816102c2565b81146102e057600080fd5b50565b6000813590506102f2816102cc565b92915050565b600080fd5b600081905082602060080282011115610319576103186102f8565b5b92915050565b6000806000806000610180868803121561033c5761033b6102bd565b5b600061034a888289016102e3565b955050602061035b888289016102e3565b945050604061036c888289016102e3565b935050606061037d888289016102e3565b925050608061038e888289016102fd565b9150509295509295909350565b6103a4816102c2565b82525050565b60006020820190506103bf600083018461039b565b92915050565b6000602082840312156103db576103da6102bd565b5b60006103e9848285016102e3565b91505092915050565b82818337505050565b61040861010083836103f2565b5050565b60006101c082019050610422600083018a61039b565b61042f602083018961039b565b61043c604083018861039b565b610449606083018761039b565b610456608083018661039b565b61046360a083018561039b565b61047060c08301846103fb565b98975050505050505050565b6000604082019050610491600083018561039b565b61049e602083018461039b565b939250505056fea26469706673582212204e55122b6afd94ae34af34764263b41bcb463e4fc817ea7ab795705071f8e56f64736f6c63430008170033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b60405161006691906102a2565b60405180910390f35b6100896004803603810190610084919061031f565b6100e9565b005b61009361018b565b6040516100a091906103aa565b60405180910390f35b6100c360048036038101906100be91906103c5565b610191565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632694b47660015487878787600154886040518863ffffffff1660e01b8152600401610152979695949392919061040c565b600060405180830381600087803b15801561016c57600080fd5b505af1158015610180573d6000803e3d6000fd5b505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101ee92919061047c565b600060405180830381600087803b15801561020857600080fd5b505af115801561021c573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061026861026361025e84610223565b610243565b610223565b9050919050565b600061027a8261024d565b9050919050565b600061028c8261026f565b9050919050565b61029c81610281565b82525050565b60006020820190506102b76000830184610293565b92915050565b600080fd5b6000819050919050565b6102d5816102c2565b81146102e057600080fd5b50565b6000813590506102f2816102cc565b92915050565b600080fd5b600081905082602060080282011115610319576103186102f8565b5b92915050565b6000806000806000610180868803121561033c5761033b6102bd565b5b600061034a888289016102e3565b955050602061035b888289016102e3565b945050604061036c888289016102e3565b935050606061037d888289016102e3565b925050608061038e888289016102fd565b9150509295509295909350565b6103a4816102c2565b82525050565b60006020820190506103bf600083018461039b565b92915050565b6000602082840312156103db576103da6102bd565b5b60006103e9848285016102e3565b91505092915050565b82818337505050565b61040861010083836103f2565b5050565b60006101c082019050610422600083018a61039b565b61042f602083018961039b565b61043c604083018861039b565b610449606083018761039b565b610456608083018661039b565b61046360a083018561039b565b61047060c08301846103fb565b98975050505050505050565b6000604082019050610491600083018561039b565b61049e602083018461039b565b939250505056fea26469706673582212204e55122b6afd94ae34af34764263b41bcb463e4fc817ea7ab795705071f8e56f64736f6c63430008170033", - "linkReferences": {}, - "deployedLinkReferences": {} + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "groupId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "identityCommitment", + "type": "uint256" + } + ], + "name": "joinGroup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "semaphore", + "outputs": [ + { + "internalType": "contract ISemaphore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "merkleTreeDepth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "merkleTreeRoot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nullifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feedback", + "type": "uint256" + }, + { + "internalType": "uint256[8]", + "name": "points", + "type": "uint256[8]" + } + ], + "name": "sendFeedback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50604051610851380380610851833981810160405281019061003291906101ba565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c96e71fb600154306040518363ffffffff1660e01b81526004016100d6929190610218565b600060405180830381600087803b1580156100f057600080fd5b505af1158015610104573d6000803e3d6000fd5b505050505050610241565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061013f82610114565b9050919050565b600061015182610134565b9050919050565b61016181610146565b811461016c57600080fd5b50565b60008151905061017e81610158565b92915050565b6000819050919050565b61019781610184565b81146101a257600080fd5b50565b6000815190506101b48161018e565b92915050565b600080604083850312156101d1576101d061010f565b5b60006101df8582860161016f565b92505060206101f0858286016101a5565b9150509250929050565b61020381610184565b82525050565b61021281610134565b82525050565b600060408201905061022d60008301856101fa565b61023a6020830184610209565b9392505050565b610601806102506000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b6040516100669190610301565b60405180910390f35b6100896004803603810190610084919061037e565b6100e9565b005b6100936101ea565b6040516100a09190610409565b60405180910390f35b6100c360048036038101906100be9190610424565b6101f0565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040518060c001604052808781526020018681526020018581526020018481526020016001548152602001836008806020026040519081016040528092919082600860200280828437600081840152601f19601f820116905080830192505050505050815250905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0d898dd600154836040518363ffffffff1660e01b81526004016101b0929190610578565b600060405180830381600087803b1580156101ca57600080fd5b505af11580156101de573d6000803e3d6000fd5b50505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b815260040161024d9291906105a2565b600060405180830381600087803b15801561026757600080fd5b505af115801561027b573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006102c76102c26102bd84610282565b6102a2565b610282565b9050919050565b60006102d9826102ac565b9050919050565b60006102eb826102ce565b9050919050565b6102fb816102e0565b82525050565b600060208201905061031660008301846102f2565b92915050565b600080fd5b6000819050919050565b61033481610321565b811461033f57600080fd5b50565b6000813590506103518161032b565b92915050565b600080fd5b60008190508260206008028201111561037857610377610357565b5b92915050565b6000806000806000610180868803121561039b5761039a61031c565b5b60006103a988828901610342565b95505060206103ba88828901610342565b94505060406103cb88828901610342565b93505060606103dc88828901610342565b92505060806103ed8882890161035c565b9150509295509295909350565b61040381610321565b82525050565b600060208201905061041e60008301846103fa565b92915050565b60006020828403121561043a5761043961031c565b5b600061044884828501610342565b91505092915050565b61045a81610321565b82525050565b600060089050919050565b600081905092915050565b6000819050919050565b600061048c8383610451565b60208301905092915050565b6000602082019050919050565b6104ae81610460565b6104b8818461046b565b92506104c382610476565b8060005b838110156104f45781516104db8782610480565b96506104e683610498565b9250506001810190506104c7565b505050505050565b6101a0820160008201516105136000850182610451565b5060208201516105266020850182610451565b5060408201516105396040850182610451565b50606082015161054c6060850182610451565b50608082015161055f6080850182610451565b5060a082015161057260a08501826104a5565b50505050565b60006101c08201905061058e60008301856103fa565b61059b60208301846104fc565b9392505050565b60006040820190506105b760008301856103fa565b6105c460208301846103fa565b939250505056fea26469706673582212208d1f71499c8710ebb4fc00256397c0764cbf05c24c0a365e44aa27667881cde864736f6c63430008170033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d2534146100515780637b85d27a1461006f578063a0f44c921461008b578063eed02e4b146100a9575b600080fd5b6100596100c5565b6040516100669190610301565b60405180910390f35b6100896004803603810190610084919061037e565b6100e9565b005b6100936101ea565b6040516100a09190610409565b60405180910390f35b6100c360048036038101906100be9190610424565b6101f0565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040518060c001604052808781526020018681526020018581526020018481526020016001548152602001836008806020026040519081016040528092919082600860200280828437600081840152601f19601f820116905080830192505050505050815250905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0d898dd600154836040518363ffffffff1660e01b81526004016101b0929190610578565b600060405180830381600087803b1580156101ca57600080fd5b505af11580156101de573d6000803e3d6000fd5b50505050505050505050565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b815260040161024d9291906105a2565b600060405180830381600087803b15801561026757600080fd5b505af115801561027b573d6000803e3d6000fd5b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006102c76102c26102bd84610282565b6102a2565b610282565b9050919050565b60006102d9826102ac565b9050919050565b60006102eb826102ce565b9050919050565b6102fb816102e0565b82525050565b600060208201905061031660008301846102f2565b92915050565b600080fd5b6000819050919050565b61033481610321565b811461033f57600080fd5b50565b6000813590506103518161032b565b92915050565b600080fd5b60008190508260206008028201111561037857610377610357565b5b92915050565b6000806000806000610180868803121561039b5761039a61031c565b5b60006103a988828901610342565b95505060206103ba88828901610342565b94505060406103cb88828901610342565b93505060606103dc88828901610342565b92505060806103ed8882890161035c565b9150509295509295909350565b61040381610321565b82525050565b600060208201905061041e60008301846103fa565b92915050565b60006020828403121561043a5761043961031c565b5b600061044884828501610342565b91505092915050565b61045a81610321565b82525050565b600060089050919050565b600081905092915050565b6000819050919050565b600061048c8383610451565b60208301905092915050565b6000602082019050919050565b6104ae81610460565b6104b8818461046b565b92506104c382610476565b8060005b838110156104f45781516104db8782610480565b96506104e683610498565b9250506001810190506104c7565b505050505050565b6101a0820160008201516105136000850182610451565b5060208201516105266020850182610451565b5060408201516105396040850182610451565b50606082015161054c6060850182610451565b50608082015161055f6080850182610451565b5060a082015161057260a08501826104a5565b50505050565b60006101c08201905061058e60008301856103fa565b61059b60208301846104fc565b9392505050565b60006040820190506105b760008301856103fa565b6105c460208301846103fa565b939250505056fea26469706673582212208d1f71499c8710ebb4fc00256397c0764cbf05c24c0a365e44aa27667881cde864736f6c63430008170033", + "linkReferences": {}, + "deployedLinkReferences": {} } diff --git a/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/api/feedback.ts b/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/api/feedback.ts index 292a7e46..12361f33 100644 --- a/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/api/feedback.ts +++ b/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/api/feedback.ts @@ -30,10 +30,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const signer = new Wallet(ethereumPrivateKey, provider) const contract = new Contract(contractAddress, Feedback.abi, signer) - const { feedback, merkleTreeDepth, merkleTreeRoot, nullifier, proof } = req.body + const { feedback, merkleTreeDepth, merkleTreeRoot, nullifier, points } = req.body try { - const transaction = await contract.sendFeedback(merkleTreeDepth, merkleTreeRoot, nullifier, feedback, proof) + const transaction = await contract.sendFeedback(merkleTreeDepth, merkleTreeRoot, nullifier, feedback, points) await transaction.wait() diff --git a/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/proofs.tsx b/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/proofs.tsx index 34a17731..79197c89 100644 --- a/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/proofs.tsx +++ b/packages/cli-template-monorepo-subgraph/apps/web-app/src/pages/proofs.tsx @@ -1,6 +1,7 @@ import { Group } from "@semaphore-protocol/group" import { Identity } from "@semaphore-protocol/identity" import { generateProof } from "@semaphore-protocol/proof" +import { encodeBytes32String } from "ethers" import getNextConfig from "next/config" import { useRouter } from "next/router" import { useCallback, useContext, useEffect, useState } from "react" @@ -8,7 +9,6 @@ import Feedback from "../../contract-artifacts/Feedback.json" import Stepper from "../components/Stepper" import LogsContext from "../context/LogsContext" import SemaphoreContext from "../context/SemaphoreContext" -import { encodeBytes32String } from "ethers" const { publicRuntimeConfig: env } = getNextConfig() @@ -55,7 +55,7 @@ export default function ProofsPage() { group.addMembers(_users) - const { proof, merkleTreeDepth, merkleTreeRoot, nullifier } = await generateProof( + const { points, merkleTreeDepth, merkleTreeRoot, nullifier } = await generateProof( _identity, group, message, @@ -72,7 +72,7 @@ export default function ProofsPage() { abi: Feedback.abi, address: env.FEEDBACK_CONTRACT_ADDRESS, functionName: "sendFeedback", - functionParameters: [merkleTreeDepth, merkleTreeRoot, nullifier, message, proof] + functionParameters: [merkleTreeDepth, merkleTreeRoot, nullifier, message, points] }) }) } else { @@ -84,7 +84,7 @@ export default function ProofsPage() { merkleTreeDepth, merkleTreeRoot, nullifier, - proof + points }) }) } diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index d4ab0bfb..96f7a71c 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -341,8 +341,8 @@ program const content = `${chalk.bold("Proofs")} (${validatedProofs.length}): \n${validatedProofs .map( - ({ message, merkleTreeRoot, merkleTreeDepth, scope, nullifier, proof }: any, i: number) => - ` ${i}. message: ${message} \n merkleTreeRoot: ${merkleTreeRoot} \n merkleTreeDepth: ${merkleTreeDepth} \n scope: ${scope} \n nullifier: ${nullifier} \n proof: [${proof.join( + ({ message, merkleTreeRoot, merkleTreeDepth, scope, nullifier, points }: any, i: number) => + ` ${i}. message: ${message} \n merkleTreeRoot: ${merkleTreeRoot} \n merkleTreeDepth: ${merkleTreeDepth} \n scope: ${scope} \n nullifier: ${nullifier} \n points: [${points.join( ", " )}]` ) diff --git a/packages/contracts/contracts/Semaphore.sol b/packages/contracts/contracts/Semaphore.sol index fe83ec53..e8da5bb6 100644 --- a/packages/contracts/contracts/Semaphore.sol +++ b/packages/contracts/contracts/Semaphore.sol @@ -121,7 +121,7 @@ contract Semaphore is ISemaphore, SemaphoreGroups { proof.nullifier, proof.message, proof.scope, - proof.proof + proof.points ); } @@ -158,9 +158,9 @@ contract Semaphore is ISemaphore, SemaphoreGroups { return verifier.verifyProof( - [proof.proof[0], proof.proof[1]], - [[proof.proof[2], proof.proof[3]], [proof.proof[4], proof.proof[5]]], - [proof.proof[6], proof.proof[7]], + [proof.points[0], proof.points[1]], + [[proof.points[2], proof.points[3]], [proof.points[4], proof.points[5]]], + [proof.points[6], proof.points[7]], [proof.merkleTreeRoot, proof.nullifier, _hash(proof.message), _hash(proof.scope)], proof.merkleTreeDepth ); diff --git a/packages/contracts/contracts/interfaces/ISemaphore.sol b/packages/contracts/contracts/interfaces/ISemaphore.sol index b81e7190..a72ea688 100644 --- a/packages/contracts/contracts/interfaces/ISemaphore.sol +++ b/packages/contracts/contracts/interfaces/ISemaphore.sol @@ -24,7 +24,7 @@ interface ISemaphore { uint256 nullifier; uint256 message; uint256 scope; - uint256[8] proof; + uint256[8] points; } /// @dev Emitted when the Merkle tree duration of a group is updated. @@ -44,7 +44,7 @@ interface ISemaphore { /// @param nullifier: Nullifier. /// @param message: Semaphore message. /// @param scope: Scope. - /// @param proof: Zero-knowledge proof. + /// @param points: Zero-knowledge points. event ProofValidated( uint256 indexed groupId, uint256 merkleTreeDepth, @@ -52,7 +52,7 @@ interface ISemaphore { uint256 nullifier, uint256 message, uint256 indexed scope, - uint256[8] proof + uint256[8] points ); /// @dev See {SemaphoreGroups-_createGroup}. diff --git a/packages/contracts/deployed-contracts/sepolia.json b/packages/contracts/deployed-contracts/sepolia.json index cafbf2c2..9f4b8571 100644 --- a/packages/contracts/deployed-contracts/sepolia.json +++ b/packages/contracts/deployed-contracts/sepolia.json @@ -1,5 +1,5 @@ { - "Verifier": "0xbFc3F24cB7fa3285cd403C66925961991757780e", - "Poseidon": "0xbdC436c93B3a71A6ac97E0Cd8b82AdaEf942D9d7", - "Semaphore": "0x021dC8BF0eADd9C128490A976756C1b052edF99d" + "Verifier": "0xf2e44cC007f0c0965875dB77152a757159e4507D", + "Poseidon": "0x31cF407EA3964c092F9E171D3692e9B7466288ca", + "Semaphore": "0xb25E63B115Ffba085FeCbf196a8e720F85DC351c" } diff --git a/packages/contracts/test/Semaphore.ts b/packages/contracts/test/Semaphore.ts index 727537aa..073af786 100644 --- a/packages/contracts/test/Semaphore.ts +++ b/packages/contracts/test/Semaphore.ts @@ -307,12 +307,12 @@ describe("Semaphore", () => { .to.emit(semaphoreContract, "ProofValidated") .withArgs( groupOneMemberId, - fullProof.merkleTreeDepth, + fullProofOneMember.merkleTreeDepth, fullProofOneMember.merkleTreeRoot, fullProofOneMember.nullifier, fullProofOneMember.message, fullProofOneMember.merkleTreeRoot, - fullProofOneMember.proof + fullProofOneMember.points ) }) @@ -328,7 +328,7 @@ describe("Semaphore", () => { fullProof.nullifier, fullProof.message, fullProof.merkleTreeRoot, - fullProof.proof + fullProof.points ) }) diff --git a/packages/data/src/ethers.ts b/packages/data/src/ethers.ts index 4867f611..5de23992 100644 --- a/packages/data/src/ethers.ts +++ b/packages/data/src/ethers.ts @@ -55,8 +55,8 @@ export default class SemaphoreEthers { options.startBlock ??= 33995010 break case "sepolia": - options.address ??= "0x021dC8BF0eADd9C128490A976756C1b052edF99d" - options.startBlock ??= 5108003 + options.address ??= "0xb25E63B115Ffba085FeCbf196a8e720F85DC351c" + options.startBlock ??= 5145333 break case "optimism-sepolia": options.address ??= "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131" @@ -301,7 +301,7 @@ export default class SemaphoreEthers { nullifier: event[3].toString(), message: event[4].toString(), scope: event[5].toString(), - proof: event[6].map((p: any) => p.toString()) + points: event[6].map((p: any) => p.toString()) })) } diff --git a/packages/data/src/getURL.ts b/packages/data/src/getURL.ts index 876612b5..a63db936 100644 --- a/packages/data/src/getURL.ts +++ b/packages/data/src/getURL.ts @@ -12,7 +12,7 @@ export default function getURL(supportedNetwork: SupportedNetwork | string): str case "optimism-sepolia": case "arbitrum-sepolia": case "arbitrum": - return `https://api.studio.thegraph.com/query/14377/semaphore-${supportedNetwork}/v4.0.0-alpha.2` + return `https://api.studio.thegraph.com/query/14377/semaphore-${supportedNetwork}/v4.0.0-alpha.3` default: throw new TypeError(`Network '${supportedNetwork}' is not supported`) } diff --git a/packages/data/src/subgraph.ts b/packages/data/src/subgraph.ts index 2c61a1c1..a7423168 100644 --- a/packages/data/src/subgraph.ts +++ b/packages/data/src/subgraph.ts @@ -120,7 +120,7 @@ export default class SemaphoreSubgraph { merkleTreeDepth scope nullifier - proof + points timestamp }` : "" @@ -183,7 +183,7 @@ export default class SemaphoreSubgraph { merkleTreeDepth scope nullifier - proof + points timestamp }` : "" diff --git a/packages/data/src/types/index.ts b/packages/data/src/types/index.ts index 7b64df33..d6f3d11b 100644 --- a/packages/data/src/types/index.ts +++ b/packages/data/src/types/index.ts @@ -44,7 +44,7 @@ export type GroupResponse = { merkleTreeDepth: number scope: string nullifier: string - proof: string[] + points: string[] timestamp?: string }[] } diff --git a/packages/data/tests/subgraph.test.ts b/packages/data/tests/subgraph.test.ts index e5f399c7..c561946b 100644 --- a/packages/data/tests/subgraph.test.ts +++ b/packages/data/tests/subgraph.test.ts @@ -129,7 +129,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306917" }, { @@ -138,7 +138,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306923" } ] @@ -170,7 +170,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306917" }, { @@ -179,7 +179,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306923" } ] @@ -289,7 +289,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306917" }, { @@ -298,7 +298,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306923" } ] @@ -329,7 +329,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306917" }, { @@ -338,7 +338,7 @@ describe("SemaphoreSubgraph", () => { merkleTreeDepth: "32", scope: "14324", nullifier: "442342", - proof: ["442342"], + points: ["442342"], timestamp: "1657306923" } ] diff --git a/packages/proof/src/generate-proof.ts b/packages/proof/src/generate-proof.ts index a6b46ec3..db198085 100644 --- a/packages/proof/src/generate-proof.ts +++ b/packages/proof/src/generate-proof.ts @@ -5,7 +5,7 @@ import type { Identity } from "@semaphore-protocol/identity" import { NumericString, prove } from "@zk-kit/groth16" import getSnarkArtifacts from "./get-snark-artifacts.node" import hash from "./hash" -import packProof from "./pack-proof" +import packPoints from "./pack-proof" import { SemaphoreProof, SnarkArtifacts } from "./types" /** @@ -76,6 +76,6 @@ export default async function generateProof( nullifier: publicSignals[1], message: BigNumber.from(message).toString() as NumericString, scope: BigNumber.from(scope).toString() as NumericString, - proof: packProof(proof) + points: packPoints(proof) } } diff --git a/packages/proof/src/index.ts b/packages/proof/src/index.ts index 3bcb0ba9..d61df148 100644 --- a/packages/proof/src/index.ts +++ b/packages/proof/src/index.ts @@ -1,8 +1,8 @@ import generateProof from "./generate-proof" import getSnarkArtifacts from "./get-snark-artifacts.node" -import packProof from "./pack-proof" -import unpackProof from "./unpack-proof" +import packPoints from "./pack-proof" +import unpackPoints from "./unpack-proof" import verifyProof from "./verify-proof" export * from "./types" -export { generateProof, getSnarkArtifacts, packProof, unpackProof, verifyProof } +export { generateProof, getSnarkArtifacts, packPoints, unpackPoints, verifyProof } diff --git a/packages/proof/src/pack-proof.ts b/packages/proof/src/pack-proof.ts index 01ce3c9a..847130be 100644 --- a/packages/proof/src/pack-proof.ts +++ b/packages/proof/src/pack-proof.ts @@ -1,12 +1,12 @@ import { Groth16Proof } from "@zk-kit/groth16" -import { PackedProof } from "./types" +import { PackedPoints } from "./types" /** - * Packs a proof into a format compatible with Semaphore. - * @param proof The Groth16 proof generated with SnarkJS. - * @returns The proof compatible with Semaphore. + * Packs the Groth16 proof points into a format compatible with Semaphore. + * @param proof The proof points generated with SnarkJS. + * @returns The proof points compatible with Semaphore. */ -export default function packProof(proof: Groth16Proof): PackedProof { +export default function packPoints(proof: Groth16Proof): PackedPoints { return [ proof.pi_a[0], proof.pi_a[1], diff --git a/packages/proof/src/types/index.ts b/packages/proof/src/types/index.ts index 8d5cb4fa..15582ba2 100644 --- a/packages/proof/src/types/index.ts +++ b/packages/proof/src/types/index.ts @@ -13,10 +13,10 @@ export type SemaphoreProof = { message: NumericString nullifier: NumericString scope: NumericString - proof: PackedProof + points: PackedPoints } -export type PackedProof = [ +export type PackedPoints = [ NumericString, NumericString, NumericString, diff --git a/packages/proof/src/unpack-proof.ts b/packages/proof/src/unpack-proof.ts index 35025284..fa4ef84c 100644 --- a/packages/proof/src/unpack-proof.ts +++ b/packages/proof/src/unpack-proof.ts @@ -1,12 +1,12 @@ import { Groth16Proof } from "@zk-kit/groth16" -import { PackedProof } from "./types" +import { PackedPoints } from "./types" /** - * Unpacks a proof into its original form. - * @param proof The proof compatible with Semaphore. - * @returns The proof compatible with SnarkJS. + * Unpacks the Groth16 proof points into their original form. + * @param proof The proof points compatible with Semaphore. + * @returns The proof points compatible with SnarkJS. */ -export default function unpackProof(proof: PackedProof): Groth16Proof { +export default function unpackPoints(proof: PackedPoints): Groth16Proof { return { pi_a: [proof[0], proof[1]], pi_b: [ diff --git a/packages/proof/src/verify-proof.ts b/packages/proof/src/verify-proof.ts index dd690670..2c592fb7 100644 --- a/packages/proof/src/verify-proof.ts +++ b/packages/proof/src/verify-proof.ts @@ -1,8 +1,8 @@ import { verify } from "@zk-kit/groth16" -import { SemaphoreProof } from "./types" -import unpackProof from "./unpack-proof" -import verificationKeys from "./verification-keys.json" import hash from "./hash" +import { SemaphoreProof } from "./types" +import unpackPoints from "./unpack-proof" +import verificationKeys from "./verification-keys.json" /** * Verifies a Semaphore proof. @@ -16,7 +16,7 @@ export default async function verifyProof({ nullifier, message, scope, - proof + points }: SemaphoreProof): Promise { // TODO: support all tree depths after trusted-setup. if (merkleTreeDepth < 1 || merkleTreeDepth > 12) { @@ -31,6 +31,6 @@ export default async function verifyProof({ return verify(verificationKey, { publicSignals: [merkleTreeRoot, nullifier, hash(message), hash(scope)], - proof: unpackProof(proof) + proof: unpackPoints(points) }) } diff --git a/packages/proof/tests/index.test.ts b/packages/proof/tests/index.test.ts index ab5b8974..ed273976 100644 --- a/packages/proof/tests/index.test.ts +++ b/packages/proof/tests/index.test.ts @@ -2,7 +2,7 @@ import { formatBytes32String } from "@ethersproject/strings" import { Group } from "@semaphore-protocol/group" import { Identity } from "@semaphore-protocol/identity" import { getCurveFromName } from "ffjavascript" -import { SemaphoreProof, generateProof, packProof, unpackProof, verifyProof } from "../src" +import { SemaphoreProof, generateProof, packPoints, unpackPoints, verifyProof } from "../src" describe("Proof", () => { const treeDepth = 10 @@ -66,10 +66,10 @@ describe("Proof", () => { describe("# packProof/unpackProof", () => { it("Should return a packed proof", async () => { - const originalProof = unpackProof(fullProof.proof) - const proof = packProof(originalProof) + const originalProof = unpackPoints(fullProof.points) + const proof = packPoints(originalProof) - expect(proof).toStrictEqual(fullProof.proof) + expect(proof).toStrictEqual(fullProof.points) }) }) })