@excubiae/contracts
Version:
467 lines (466 loc) • 16.8 kB
JSON
{
"_format": "hh-sol-artifact-1",
"contractName": "SemaphoreMock",
"sourceName": "contracts/test/extensions/mocks/SemaphoreMock.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256[]",
"name": "_groupIds",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "_nullifiers",
"type": "uint256[]"
},
{
"internalType": "bool[]",
"name": "_validities",
"type": "bool[]"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"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"
},
{
"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": "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": "",
"type": "uint256"
}
],
"name": "acceptGroupAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "addMember",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"name": "addMembers",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "createGroup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "createGroup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "createGroup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "groupCounter",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "mockedGroups",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"name": "removeMember",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "updateGroupAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "updateGroupMerkleTreeDuration",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"name": "updateMember",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"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": "",
"type": "tuple"
}
],
"name": "validateProof",
"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": "verifyProof",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506040516107ef3803806107ef83398101604081905261002f916101ec565b60005b835181101561009f576001600080868481518110610052576100526102ea565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055506002600081548092919061009290610300565b9091555050600101610032565b5060005b825181101561010d578181815181106100be576100be6102ea565b6020026020010151600160008584815181106100dc576100dc6102ea565b6020908102919091018101518252810191909152604001600020805460ff19169115159190911790556001016100a3565b50505050610327565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561015457610154610116565b604052919050565b60006001600160401b0382111561017557610175610116565b5060051b60200190565b600082601f83011261019057600080fd5b81516101a361019e8261015c565b61012c565b8082825260208201915060208360051b8601019250858311156101c557600080fd5b602085015b838110156101e25780518352602092830192016101ca565b5095945050505050565b60008060006060848603121561020157600080fd5b83516001600160401b0381111561021757600080fd5b6102238682870161017f565b602086015190945090506001600160401b0381111561024157600080fd5b61024d8682870161017f565b604086015190935090506001600160401b0381111561026b57600080fd5b8401601f8101861361027c57600080fd5b805161028a61019e8261015c565b8082825260208201915060208360051b8501019250888311156102ac57600080fd5b6020840193505b828410156102dc57835180151581146102cb57600080fd5b8252602093840193909101906102b3565b809450505050509250925092565b634e487b7160e01b600052603260045260246000fd5b60006001820161032057634e487b7160e01b600052601160045260246000fd5b5060010190565b6104b9806103366000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80635c3f3b601161008c578063d24924fe11610066578063d24924fe146101c2578063da3cda52146101cb578063fbad4139146101dc578063fcf0b6ec1461010457600080fd5b80635c3f3b601461018c5780636cdd32fe146101a0578063d0d898dd146101b457600080fd5b80634178c4d5116100c85780634178c4d51461013f578063456f418814610154578063568ee82614610177578063575185ed1461018557600080fd5b806304245371146100ef5780631783efc3146101045780632c88036314610116575b600080fd5b6101026100fd366004610281565b505050565b005b6101026101123660046102cd565b5050565b61012c61012436600461030b565b600092915050565b6040519081526020015b60405180910390f35b61010261014d366004610335565b5050505050565b610167610162366004610396565b6101ff565b6040519015158152602001610136565b6101026101123660046103d0565b600061012c565b61012c61019a3660046103fc565b50600090565b6101026101ae366004610417565b50505050565b610102610112366004610396565b61012c60025481565b6101026101d936600461046a565b50565b6101676101ea36600461046a565b60006020819052908152604090205460ff1681565b60008281526020819052604081205460ff16801561022e575060408083013560009081526001602052205460ff165b9392505050565b60008083601f84011261024757600080fd5b50813567ffffffffffffffff81111561025f57600080fd5b6020830191508360208260051b850101111561027a57600080fd5b9250929050565b60008060006040848603121561029657600080fd5b83359250602084013567ffffffffffffffff8111156102b457600080fd5b6102c086828701610235565b9497909650939450505050565b600080604083850312156102e057600080fd5b50508035926020909101359150565b80356001600160a01b038116811461030657600080fd5b919050565b6000806040838503121561031e57600080fd5b610327836102ef565b946020939093013593505050565b60008060008060006080868803121561034d57600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff81111561037957600080fd5b61038588828901610235565b969995985093965092949392505050565b6000808284036101c08112156103ab57600080fd5b833592506101a0601f19820112156103c257600080fd5b506020830190509250929050565b600080604083850312156103e357600080fd5b823591506103f3602084016102ef565b90509250929050565b60006020828403121561040e57600080fd5b61022e826102ef565b6000806000806060858703121561042d57600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561045257600080fd5b61045e87828801610235565b95989497509550505050565b60006020828403121561047c57600080fd5b503591905056fea26469706673582212202c03fa9ff30274ee74c709d858418446682a5f7f49124fce75cbdc7869f52d3a64736f6c634300081c0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80635c3f3b601161008c578063d24924fe11610066578063d24924fe146101c2578063da3cda52146101cb578063fbad4139146101dc578063fcf0b6ec1461010457600080fd5b80635c3f3b601461018c5780636cdd32fe146101a0578063d0d898dd146101b457600080fd5b80634178c4d5116100c85780634178c4d51461013f578063456f418814610154578063568ee82614610177578063575185ed1461018557600080fd5b806304245371146100ef5780631783efc3146101045780632c88036314610116575b600080fd5b6101026100fd366004610281565b505050565b005b6101026101123660046102cd565b5050565b61012c61012436600461030b565b600092915050565b6040519081526020015b60405180910390f35b61010261014d366004610335565b5050505050565b610167610162366004610396565b6101ff565b6040519015158152602001610136565b6101026101123660046103d0565b600061012c565b61012c61019a3660046103fc565b50600090565b6101026101ae366004610417565b50505050565b610102610112366004610396565b61012c60025481565b6101026101d936600461046a565b50565b6101676101ea36600461046a565b60006020819052908152604090205460ff1681565b60008281526020819052604081205460ff16801561022e575060408083013560009081526001602052205460ff165b9392505050565b60008083601f84011261024757600080fd5b50813567ffffffffffffffff81111561025f57600080fd5b6020830191508360208260051b850101111561027a57600080fd5b9250929050565b60008060006040848603121561029657600080fd5b83359250602084013567ffffffffffffffff8111156102b457600080fd5b6102c086828701610235565b9497909650939450505050565b600080604083850312156102e057600080fd5b50508035926020909101359150565b80356001600160a01b038116811461030657600080fd5b919050565b6000806040838503121561031e57600080fd5b610327836102ef565b946020939093013593505050565b60008060008060006080868803121561034d57600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff81111561037957600080fd5b61038588828901610235565b969995985093965092949392505050565b6000808284036101c08112156103ab57600080fd5b833592506101a0601f19820112156103c257600080fd5b506020830190509250929050565b600080604083850312156103e357600080fd5b823591506103f3602084016102ef565b90509250929050565b60006020828403121561040e57600080fd5b61022e826102ef565b6000806000806060858703121561042d57600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561045257600080fd5b61045e87828801610235565b95989497509550505050565b60006020828403121561047c57600080fd5b503591905056fea26469706673582212202c03fa9ff30274ee74c709d858418446682a5f7f49124fce75cbdc7869f52d3a64736f6c634300081c0033",
"linkReferences": {},
"deployedLinkReferences": {}
}